问题描述
我知道Monotouch,我安装了虚拟MacOS和Monodevelop / Monotouch。
I know about Monotouch and I have virtual MacOS and Monodevelop/Monotouch installed.
然而,在Mac OS X上使用Monotouch构建iPhone应用程序是否更好,或者在Visual Studio中构建iPhone应用程序并通过Monotouch将其移植到iPhone很容易?
However, is it better to build an iPhone application in Monotouch on Mac OS X or it's as easy as to build iPhone app in Visual Studio and port it to iPhone via Monotouch?
有没有人试图将c#项目移植到iPhone?使用monodevelop / monotouch在mac os上构建应用程序有何不同?
Is there anyone who tried porting c# project to iPhone? How different was it from building the app on mac os using monodevelop/monotouch?
ps。我最喜欢的帮助工具在mac os上不存在,这就是这个问题的原因
ps. my favourite helper utilities does not exist on mac os and that's the reason for this Q
推荐答案
你根本无法开发MonoTouch应用程序只使用Visual Studio。您必须使用OSX工具来构建代码并为手机创建程序包。没有办法解决这个问题,最简单的方法就是使用MonoDevelop。
You simply can't develop a MonoTouch application just using Visual Studio. You have to use the OSX tools to build the code and create the package for the phone. There's no way to work around that, and the easiest way to do it is using MonoDevelop.
我和其他开发人员过去所做的是开发一些使用Visual Studio的应用程序的C#库,因为即使MonoDevelop相当不错,它仍然远不如VS。例如,使用Resharper等工具重构代码要容易得多。
What me and other developers have done in the past is to develop some of the C# libraries for the apps using Visual Studio, because even though MonoDevelop is pretty good, its still far from being as good as VS. Refactoring code, for example, is much easier with tools like Resharper, etc.
在Visual Studio中开发应用程序时,有很多事情需要处理用;例如:
When developing the App in Visual Studio, there's a lot of things you'll have to deal with; for example:
您根本无法从Visual Studio运行构建:VS不知道如何构建必要的项目类型iPhone,它没有iOS SDK中存在的所有库。
没有可视化编辑器来创建您可能想为您的应用创建的XIB文件。
你必须在这里和那里做很多额外的工作才能让VS甚至打开解决方案(比如从OSX复制lib文件到Windows,创建单独的项目等)(尽管我认为用于VS的Novell Mono工具可能会对此有所帮助。
所以这就是我过去6年来一直在做的事情月:
So here's what I've been doing for the last 6 months:
将应用程序分解为业务逻辑和UI逻辑的不同项目
你应该能够从VS构建,编译甚至测试业务逻辑。请记住不要使用任何UI库或MonoTouch中没有的外部库
使用MonoDevelop构建应用程序的UI代码部分。能够快速运行应用程序进行测试有很大帮助。
每隔一段时间,如果您觉得需要进行大规模清理,请在Visual Studio中打开代码,然后执行重构;虽然你将无法构建任何东西,但VS中的代码检查器将有助于确保代码仍然有效。
- Break down the application into different projects for business logic and UI logicYou should be able to build, compile and even test the business logic from VS. Just remember not to use any UI libraries, or external libraries not available in MonoTouchUse MonoDevelop to build the UI code part of the app. Being able to quickly run the app to test helps a lot.Every once in a while, if you feel you need to to a big cleanup, open the code in Visual Studio, and do the refactorings; although you won't be able to build anything, the code checker in VS will help to make sure the code is still valid.
希望它有所帮助!
这篇关于在Visual Studio中使用MonoTouch开发iPhone应用程序有多容易?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!