9

I am developing and iOS app and would like to know if it is possible to use python scripts in Xcode to develop my app.

I am comfortable with objective C and I am not aiming to create my entire app using python. Most of the code will still be in objective-C. The algo that I am using is very computationally intense; and so I thought using python (along with numpy and scipy) would speed things up.

I have heard that PyObjC 'may' be useful, but I have found threads on stackoverflow stating that PyObjC is not compatible with XCode 4.

Also, is there any other better suited alternative to perform computationally heavy tasks in iOS.

Thank you for answering, in advance.

6
  • 1
    What makes you think that Python, even with numpy/scipy, would be faster for a "computationally intense" algorithm than Objective-C? Commented Feb 10, 2013 at 4:40
  • 2
    If he's more fluent with python, his coding could be cleaner and his implementations of algorithms more efficient. Commented Feb 10, 2013 at 4:41
  • 4
    In terms of execution efficiency, numpy and scipy use other libraries like LAPACK to do the real work. These libraries should be callable from Objective-C too, assuming there's an iOS version of them. Admittedly, this doesn't address the desire to use Python as a language. Commented Feb 10, 2013 at 4:57
  • 1
    for FFT & co it would be best to use Apple's accelerate framework as it has platform optimizations for each device (NEON extension to ARM, VFPv4 on iPhone 5 and so on). developer.apple.com/library/ios/#documentation/Accelerate/… Commented Feb 10, 2013 at 10:23
  • 2
    This isn't a duplicate of the linked question. The linked question refers to an approach to the answer that doesn't work. This is asking what DOES work. Commented Dec 16, 2013 at 17:04

1 Answer 1

5

I tried to install PyObjC and I finally got it running after five hours of reading stackoverflow and docs. For me this link worked like a charm: https://github.com/gregneagle/Xcode4CocoaPythonTemplates (without GUI, also see this answer). See this link for an example of using PyObjC with iOS.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.