从iOS应用程序开发切换到Mac应用程序开发时,要克服的最大障碍是什么? [英] What are the biggest obstacles to overcome when switching from iOS app development to Mac app development?

查看:175
本文介绍了从iOS应用程序开发切换到Mac应用程序开发时,要克服的最大障碍是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

据传,Mac应用程序开发与iOS应用程序开发非常相似,但当然存在很大差异。



当我们提供有关硬件和屏幕的所有事实时除了约束之外,开始使用Mac应用程序开发时iOS应用程序开发人员必须克服的最大障碍是什么?



我听过的一些可怕的事情:



误区1:在Mac上,坐标系不同。 0位于左下角。感觉就像在街道的错误一边开车。



神话2:NSView并不像UIView。 UIView总是有一个CALayer。 NSView没有。



神话3:Mac上的表格视图比iOS上的UITableView复杂得多,难以使用。



有人可以揭穿他们,或者添加其他一些人吗? API的痛苦差异在哪里?

解决方案

1和2绝对正确。 3是值得商榷的 - 有关NSTableViews的一些东西更好,例如如何使用任何对象(例如字符串,图像,数字)作为单元格值。



虽然我们然而,关于细胞的主题,这是另一个痛苦 - 许多NSView具有完成实际工作的单元属性,因此视图层次结构由单元层次结构镜像,使一切更复杂。因此,文本字段确实令人困惑。



此外,与UILabels / UIButtons相比,NSLabels / NSButton几乎无法做任何事情 - 没有字体设置,没有颜色设置,没有自定义所有 - 它们基本没用。



如果你使用Core Animation,它与视图的集成很差。因此,例如,如果它由CALayer支持,您可以在3D中转换NSView,就像在UIKit中一样,但是如果您尝试单击它,则鼠标坐标不会通过与视图外观相同的转换进行映射,因此如果你转换一个控件,它基本上变得不可点击,除非你在转换之前点击它最初在屏幕上的位置。



基本上整个Mac OS SDK都感觉不到就像它是iOS SDK的早期alpha版本一样,没有经过适当的测试,而且一些尚未投入生产的愚蠢,过于复杂的想法(单元格)尚未被取消。



< / rant>


Mac app development is rumored to be very similar to iOS app development, but of course there are big differences.

When we put all the facts about hardware and screen constraints aside, what are the biggest obstacles an experiences iOS app developer must overcome to start with Mac app development?

Some of the awful things I've heard:

Myth 1: On the Mac, the coordinate system is different. 0 is at the bottom left. Feels like driving on the wrong side of the street.

Myth 2: NSView is not really like UIView. UIView always has a CALayer. NSView doesn't.

Myth 3: Table Views on the Mac are far more complex and harder to use than UITableView on iOS.

Can someone debunk them, or add a few others? Where are the painful differences in the APIs?

解决方案

1 and 2 are absolutely true. 3 is debatable - some things about NSTableViews are nicer, such as how you can use any object (e.g. a string, image, number) as a cell value.

Whilst we're on the subject of cells though, that's another pain - many NSViews have cell properties that do the real work, so the view hierarchy is mirrored by a cell hierarchy that makes everything more complex. Text fields are really confusing because of this.

Also, NSLabels/NSButtons can hardly do anything compared with UILabels/UIButtons - no font setting, no colour setting, no customisation at all - they're basically useless.

And if you do use Core Animation, it's poorly integrated with views. So for example you can transform an NSView in 3D if it's backed by a CALayer, just like in UIKit, but if you try to click on it, the mouse co-ordinates aren't mapped by the same transform as the view appearance, so if you transform a control it basically becomes un-clickable unless you click where it was originally positioned on screen before you transformed it.

Basically the whole of the Mac OS SDK feels like it was an early alpha version of the iOS SDK that hasn't been properly tested and where some of the stupid, overcomplicated ideas (cells) that didn't make it into production haven't been taken out yet.

</rant>

这篇关于从iOS应用程序开发切换到Mac应用程序开发时,要克服的最大障碍是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆