简体   繁体   English

MonoTouch诉Objective-C适用于新的iPhone开发者

[英]MonoTouch v. Objective-C for new iPhone devs

I'm working with a small startup with the goal of creating an iPhone application. 我正在与一家小型创业公司合作,目标是创建一个iPhone应用程序。 The programmers on our team all know both C and Java, but we've got no ObjC/C#/iPhone experience -- we'll be learning something no matter what. 我们团队的程序员都知道C和Java,但我们没有ObjC / C#/ iPhone经验 - 无论如何我们都会学到一些东西。 All the questions I've seen on this subject have been from the perspective of a C# programmer getting into iOS, so I don't have any information on the relative merits of learning one or the other. 我在这个主题上看到的所有问题都是从C#程序员进入iOS的角度出发的,所以我没有关于学习其中一个的相对优点的任何信息。

So, what I want to know is the relative merits of C# and Objective-C for new programmers, with respect to these things: 所以,我想知道的是C#和Objective-C对于新程序员的相对优点,就这些事情而言:

  • Performance 性能
  • Ease of use 便于使用
  • Ease of learning 易于学习
  • Reliability (ie, will a new iOS version break a MonoTouch app?) 可靠性(即,新的iOS版本会打破MonoTouch应用吗?)

Also, would writing in MonoTouch have any benefits for cross-platform development with Android? 另外,使用Android进行跨平台开发是否会对MonoTouch进行编写?

If the goal of your startup is to create an iPhone app, then obviously you should learn the language iOS applications are built with, Objective-C. 如果你的创业公司的目标是创建一个iPhone应用程序,那么显然你应该学习iOS应用程序构建的语言Objective-C。 Your team already has experience with C, so it should be very easy to get started. 您的团队已经具有C语言的经验,因此应该非常容易上手。 The Big Nerd Ranch books will get you up and running in a week or two (I'm not associated with Big Nerd Ranch, I just think they're awesome). Big Nerd Ranch书籍将在一两周内让你起步和运行(我与Big Nerd Ranch无关,我认为它们很棒)。

I don't understand why you bring up MonoTouch, considering your team doesn't have C#/.NET experience. 我不明白为什么你提出MonoTouch,考虑到你的团队没有C#/ ..NET体验。 There are tons of other frameworks like MonoTouch, including Titanium SDK (JavaScript), RubyMotion (Ruby), and so forth. 还有很多其他框架,如MonoTouch,包括Titanium SDK (JavaScript), RubyMotion (Ruby)等等。 All of these are great, but as I see it are primarily for those with experience with their respective languages. 所有这些都很棒,但我认为这主要是针对那些有各自语言经验的人。 They allow you to write iOS applications using a language you're more familiar with, but have the following drawbacks: 它们允许您使用您更熟悉的语言编写iOS应用程序,但具有以下缺点:

  1. Performance can be just as good, but usually a little (sometimes a lot) worse than an application written in Objective-C. 性能可以同样好,但通常比用Objective-C编写的应用程序差一点(有时很多)。
  2. Resources for learning are not as plentiful as those for iOS SDK/Objective-C. 学习资源不如iOS SDK / Objective-C那样丰富。 There are tons of people who want to make iOS apps, and of those people some use these frameworks, and they are diluted amongst them. 有很多人想要制作iOS应用程序,而有些人使用这些框架,并且他们被稀释在其中。 Only a small fraction of the resources available for iOS development will be devoted to any given framework. 只有一小部分可用于iOS开发的资源将用于任何给定的框架。
  3. These frameworks are based on the iOS SDK/Objective-C, so naturally development is always a step behind. 这些框架基于iOS SDK / Objective-C,因此自然开发总是落后一步。 If Apple rolls out radically new APIs in the next version of the iOS SDK, you'll have to wait for these frameworks to adapt (applications written in Objective-C might break, too, but it'll be easier to deal with based on point #2). 如果Apple在iOS SDK的下一个版本中推出了全新的API,那么你将不得不等待这些框架适应(用Objective-C编写的应用程序也可能会破坏,但它会更容易处理第2点)。
  4. Most of these frameworks require a familiarity with the iOS SDK. 大多数这些框架都需要熟悉iOS SDK。 You will still need to know that an application calls the - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions method on launch, but in addition you will need to remember how to translate that into the appropriate method for MonoTouch: public override bool FinishedLaunching (UIApplication app, NSDictionary options) . 您仍然需要知道应用程序在启动时调用- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions方法,但此外您还需要记住如何将其转换为适当的方法MonoTouch: public override bool FinishedLaunching (UIApplication app, NSDictionary options) The iOS SDK is massive, and most iOS developers rely on Apple's documentation for insight. iOS SDK非常庞大,大多数iOS开发人员依靠Apple的文档来提供洞察力。 So you will be looking at the API docs, written for Objective-C, and translating methods into the framework of your choice. 因此,您将查看为Objective-C编写的API文档,并将方法转换为您选择的框架。
  5. The Objective-C ecosystem is constantly evolving, with cool new projects like CocoaPods , bwoken , etc. These are primarily developed with Objective-C and Xcode in mind. Objective-C生态系统不断发展,包括CocoaPodsbwoken等酷炫的新项目。这些项目主要是在考虑Objective-C和Xcode的情况下开发的。 Configuring them to work with your framework of choice will almost invariably cause you extra time and work. 配置它们以使用您选择的框架将几乎总是会给您带来额外的时间和工作。

The above points have generally kept me from delving too much into any of these other frameworks. 以上几点一般使我无法深入研究其他任何框架。 They're all very cool, but their primary merit in adoption seems to be facilitating development for people with deep skill sets outside of Objective-C, or allowing cross-platform development for small teams lacking the resources to invest in Android and iOS (and Windows Phone) programmers. 它们都非常酷,但它们在采用中的主要优点似乎是促进了Objective-C之外具有深厚技能的人的开发,或允许小型团队进行跨平台开发,缺乏投资Android iOS的资源(以及Windows Phone)程序员。 Hopefully the benefits outweigh the above costs for adopters. 希望这些好处超过上述采用者的成本。

Also, would writing in MonoTouch have any benefits for cross-platform development with Android? 另外,使用Android进行跨平台开发是否会对MonoTouch进行编写?

I suppose it would. 我想会的。 Indeed, the MonoTouch homepage touts that as a primary advantage of using the framework. 实际上, MonoTouch主页宣称这是使用框架的主要优势。 I'm not so sure about view/controller classes, since those seem like they would be tied into UIKit , but the logic encapsulated in your models should be fairly easy to port. 我对视图/控制器类不太确定,因为它们似乎与UIKit绑定,但封装在模型中的逻辑应该相当容易移植。

Long story short, I think you and your team should stick with Objective-C for iOS development. 简而言之,我认为您和您的团队应该坚持使用Objective-C进行iOS开发。

如果您只是构建一个iPhone应用程序,那么请务必选择Objective C.但如果您想要一个移动应用程序 - 可能包括Android,Windows Phone,Windows rt,blackberry,webos或其他选项 - 您可能想要仔细观察一些替代平台,MonoTouch是其中一个突出的选择。

Objective C is a strict superset of C, so if you understand the performance characteristics of compiled C code on ARM, you can just use that C subset with which you are familiar, except for the iOS UI. Objective C是C的严格超集,因此如果您了解ARM上已编译C代码的性能特征,您可以使用您熟悉的C子集,iOS UI除外。

There seem to exist reports that experienced C programmers start getting up to speed with writing iOS apps in Objective C in on the order of 2 weeks. 似乎存在经验丰富的C程序员开始在Objective C中编写iOS应用程序大约2周的速度。 But, of course, learning extensive frameworks and APIs in an ongoing learning process, whatever the language. 但是,当然,无论语言如何,都要在不断学习的过程中学习广泛的框架和API。

For performance, the answer is Objective-C, all the way. 对于性能,答案是Objective-C,一直以来。

That said, take a look at doing this with HTML5. 也就是说,看看用HTML5做这件事。 If you stick to accelerated transforms, HTML5 performance for an application front end is surprisingly good. 如果坚持加速转换,应用程序前端的HTML5性能会出乎意料地好。 It's also pretty easy to move your HTML5 app to Android. 将HTML5应用程序移动到Android也非常容易。

The simple answer is Objective-C. 简单的答案是Objective-C。 It's not too hard to learn. 这不是太难学。 If you're solid on C and solid on OOP, you'll be fine. 如果你在C上坚实且在OOP上坚实,你会没事的。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 MonoTouch,MonoTouch的未​​来以及我是否应该将它用于iPhone应用程序(而不是Objective-C) - MonoTouch, the future of MonoTouch and whether I should use it for iPhone apps (instead of objective-C) MonoTouch / Objective-C-检测当前可以看到多少UIImageView - MonoTouch/Objective-C - Detect How Much of a UIImageView is Currently Visible 帮助在Monotouch中绑定静态Objective-C库 - Help binding a static objective-c library in monotouch 适用于iphone应用的MonoTouch和C#VS Objective C. - MonoTouch & C# VS Objective C for iphone app Objective-C / iPhone中的公钥加密 - Public key encryption in objective-C/iPhone 在没有MonoTouch托管类的情况下获取Objective-C类名 - Getting an Objective-C class name without having a MonoTouch managed class MonoTouch.Foundation.MonoTouchException 已抛出 Objective-C 异常抛出。 名称:NSInternalInconsistencyException - MonoTouch.Foundation.MonoTouchException has been thrown Objective-C exception thrown. Name: NSInternalInconsistencyException 绑定到iOS静态库时从Monotouch访问Objective-C结构 - Accessing Objective-C structure from Monotouch while binding to iOS static library 适用于Java开发人员的IPhone的Objective-C:书籍,网站,视频? - Objective-C for IPhone for Java Developers: Books, Sites, Videos? 您真的需要知道C / C#才能在Objective-C(iPhone)中进行编码吗? - Do you really need to know C/C# to code in Objective-C (iPhone)?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM