xcode iPhone 开发和 Mac OSX 开发的区别
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/6553305/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Difference between iPhone development and Mac OSX development
提问by Legolas
This question is for all the programmers who code in iphone as well as the Mac OSX platform.
这个问题适用于所有在 iphone 以及 Mac OSX 平台上编码的程序员。
I have been searching on Google for quite some time, but I could not find any good answer, and so I am posting the question here. Please apologize if this is not a programming question.
我已经在谷歌上搜索了很长时间,但我找不到任何好的答案,所以我在这里发布了这个问题。如果这不是编程问题,请道歉。
Question on development overview:
I would like to know how the iphone development tools are different from Mac OSX development tools.
Question on the programming language:
Is the programming done in
objective-c
for mac-osx as well ? Will it be the same syntax and format (for example, to create a button or textField)... ?Question on the libraries:
If the programming is done in Xcode, how will the classes and libraries for
touch
andnavigation
be for the development in Mac OSX. ? And is there an interface builder ?Question on Simulation and Testing:
Is it as easy as iPhone development to simulate and test the app in a
Simulator
?
关于开发概述的问题:
我想知道 iphone 开发工具与 Mac OSX 开发工具有何不同。
关于编程语言的问题:
是否也
objective-c
为 mac-osx完成了编程?它的语法和格式是否相同(例如,创建按钮或文本字段)...?关于图书馆的问题:
如果编程在Xcode做,如何将类和库
touch
,并navigation
可以在Mac OSX上的发展。? 是否有界面构建器?关于仿真和测试的问题:
模拟和测试应用程序是否像 iPhone 开发一样简单
Simulator
?
采纳答案by PengOne
- Many different UI elements and interactions.
- The same.
- Different.
- IMHO yes.
- 许多不同的 UI 元素和交互。
- 相同。
- 不同的。
- 恕我直言,是的。
You may want to check out these posts to help you transition:
您可能想查看这些帖子以帮助您过渡:
回答by I?igo Beitia
Tools are the same, you'll use Xcode just as with iOS Development.
The same language and syntax is used.
There are some differences, the most important being Garbage Collection, which is available on the Mac but not on iOS. View Controllers also play a different role and, of course, different libraries and APIs are used. Most of the UI elements you're used to on the iPhone (tabbar, navbars, ...) are not present on the Mac..
In terms of testing, it is pretty straightforward like on the iPhone.
工具是相同的,您将像使用 iOS 开发一样使用 Xcode。
使用相同的语言和语法。
有一些区别,最重要的是垃圾收集,它在 Mac 上可用,但在 iOS 上不可用。视图控制器也扮演着不同的角色,当然,使用不同的库和 API。您在 iPhone 上使用的大多数 UI 元素(标签栏、导航栏等)在 Mac 上不存在。
在测试方面,它非常简单,就像在 iPhone 上一样。
回答by hotpaw2
The Apple provided tools are the same. I'ved used Xcode 3 to develop both an iPhone app and some companion Mac OSX software at the same time.
Apple 提供的工具是相同的。我使用 Xcode 3 同时开发了 iPhone 应用程序和一些配套的 Mac OSX 软件。
You can develop for both Mac and iPhone using Objective C or Swift, although there are a lot more options for programming languages on the Mac (Python, Ruby, etc.)
您可以使用 Objective C 或 Swift 为 Mac 和 iPhone 进行开发,尽管 Mac 上有更多的编程语言选项(Python、Ruby 等)
The Cocoa framework for the Mac and Cocoa Touch framework look very similar, but most have slightly different API names, calling conventions and behaviors that you will have to deal with. Plus, of course the UI is different between multi-touch and mouse/keyboard/menu/window interaction. But I took a one window one view iPhone app, and pretty much did a line-by-line translation of all the buttons, other UI elements, etc., to make a Mac version.
适用于 Mac 的 Cocoa 框架和 Cocoa Touch 框架看起来非常相似,但大多数 API 名称、调用约定和您必须处理的行为略有不同。另外,当然多点触控和鼠标/键盘/菜单/窗口交互之间的 UI 是不同的。但是我使用了一个单窗口一个视图的 iPhone 应用程序,几乎对所有按钮、其他 UI 元素等进行了逐行翻译,以制作 Mac 版本。
The iPhone Simulator runs an iOS app compiled for it just like another Mac app, but using different frameworks inside a one window semi-sandbox.
iPhone 模拟器运行为它编译的 iOS 应用程序,就像另一个 Mac 应用程序一样,但在一个窗口半沙箱中使用不同的框架。