我可以使用Python编写本机iPhone应用程序吗
使用PyObjC,我们可以使用Python编写适用于OS X的Cocoa应用程序。我可以使用Python编写本机iPhone应用程序吗?
解决方案
回答
目前尚不可用,目前仅有的可用于访问iPhone SDK的语言是C / C ++,Objective C和Swift。
没有技术上的原因为什么将来这种情况不会改变,但我不会在短期内屏住呼吸。
也就是说,Objective-C和Swift确实不是太吓人...
2016 edit Javascript with NativeScript framework is available to use now.
回答
由于Jay Freeman(saurik)的出色工作,我们也可以在iPhone上使用PyObjC。请参阅Python中的iPhone应用程序。
请注意,目前这需要越狱的iPhone。
回答
iPhone SDK协议在是否允许我们运行脚本语言(WebView的Java脚本之外)方面也相当含糊。我的理解是,只要我们没有从网络下载执行的脚本,就可以了(因此,预安装和用户编辑的脚本似乎还可以)。
IANAL等
回答
我们可以使用PyObjC,当然也可以使用越狱的手机。但是,如果我们希望将其放入App Store,则他们将不允许它,因为它"解释了代码"。但是,我们可能可以使用Shed Skin,尽管我不知道有人这样做。不过,我想不出有什么充分的理由这样做,因为我们会丢失动态类型,并且不妨使用ObjC。
回答
在框架和兼容性方面,我所知的唯一对iPhone开发具有重要意义的"外部"语言是MonoTouch,MonoTouch是在iPhone上进行开发的C#/。NET环境。
回答
是的你可以。我们使用tinypy(受限制的Python)编写代码,然后使用tinypy将其转换为C ++,最后使用XCode将其编译为本地iPhone应用程序。菲尔·哈西(Phil Hassey)发布了一款名为"大象"的游戏!使用这种方法。这里有更多细节,
http://www.philhassey.com/blog/2009/12/23/elephants-is-free-on-the-app-store/
回答
iOS开发者协议的更新意味着我们可以使用任何我们喜欢的东西,只要我们满足开发者指南。完全删除了第3.3.1节,该节限制了开发人员可用于iOS开发的内容。
资料来源:http://daringfireball.net/2010/09/app_store_guidelines
回答
从技术上讲,只要未下载ISN的解释代码(不包括JavaScript),该应用就可以获得批准。 Rhomobiles的" Rhodes"框架就是这样做的,它捆绑了移动Ruby,轻量级的Rails和应用程序,以便通过应用程序商店进行分发。因为解释器和解释后的代码都打包到了最终应用程序中,所以Apple认为它不会令人反感。
http://rhomobile.com/products/rhodes/
即使在最新的苹果新闻稿发布之后,Rhodes应用程序(移动红宝石)仍然可以在应用程序商店中使用。我很难相信,如果有一个愿意的开发人员社区,tinyPy或者pyObjC不会找到位置。
回答
看来现在这是开发人员可以做的事情:iOS开发人员协议昨天已更改,并且似乎已进行了某种修改,以使在应用程序中嵌入Python解释器合法:
3.3.2节翻译
老的:
3.3.2 An Application may not itself install or launch other executable code by any means, including without limitation through the use of a plug-in architecture, calling other frameworks, other APIs or otherwise. Unless otherwise approved by Apple in writing, no interpreted code may be downloaded or used in an Application except for code that is interpreted and run by Apple’s Documented APIs and built-in interpreter(s). Notwithstanding the foregoing, with Apple’s prior written consent, an Application may use embedded interpreted code in a limited way if such use is solely for providing minor features or functionality that are consistent with the intended and advertised purpose of the Application.
新的:
3.3.2 An Application may not download or install executable code. Interpreted code may only be used in an Application if all scripts, code and interpreters are packaged in the Application and not downloaded. The only exception to the foregoing is scripts and code downloaded and run by Apple’s built-in WebKit framework.