views:

424

answers:

2

Hey! I have a little script I wrote in python and it actually works on the iPhone via the terminal. I am looking for code snippets or documentation for the GUI writing for the iPhone - Actually what I need is to implement an input and some output. nothing fancy - for now. I have found this page: http://www.saurik.com/id/5 but as i understand from the article i will need to write it in objective-c which i am not familiar with - do i have to? or can i write in python or just C? and it is very descriptive, looking for more docs... Thanks Alot :)

A: 

There is a GUI sample in that link. The whole app is written in Python with ObjC runtime (but no ObjC code involved).

Still, the ObjC "feel" cannot be avoided because UIKit is designed for and uses ObjC. Note that the GUI programmed in Python is extremely slow on the iPhoneOS. Python can be used as testing, but never release an (interpreted) iPhoneOS Python GUI app to public.

KennyTM
I haven't noticed the GUI being slow. Do you mean the GUI is slow when programmed from Python?
Tony Lambert
@Tony: Yes. ___
KennyTM
well, yea. thanks for the information - is the objc python is the same for the iphone as it for mac's?
Leon
@Leon: iPhone's version is 2.5. Of course you can compile a newer from source.
KennyTM
A: 

You cannot write an iPhone app in Python that will run on non-jailbroken phones. Apple's SDK license prohibits interpreted code on the iPhone, which definitely excludes Python. Although you can write OS X apps in Python using PyObjC, you still need to understand the Objective-C language both for documentation and for groking the many Cocoa patterns that are closely tied to Objective-C's way of doing things.

Learn Objective-C. For a programer that knows C or C++, it takes only a couple of days to become proficient in Objective-C. If you've never used a language that has pointers before, it may take a little longer. On the flip side, embracing Objective-C's dynamic nature is much easier for developers coming from dynamic languages as opposed to statically typed languages like C/C++/Java/C#.

Barry Wark