How to build a PyObjC project on Mac OS X 10.6 that runs 10.5?

I have a PyObjC project that I am building on Mac OS X 10.6 with Xcode 3.2, and I cannot work on 10.5.

All I use is the official PyObjC project templates to create an empty project (which just opens a window). Then I create the application and copy it to 10.5. But the application always crashes to 10.5:

Application Specific Information: *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: '/Users/hupf/Development/PyHelloWorld/main.m:44 main() PyRun_SimpleFile failed with file '/Users/hupf/Desktop/PyHelloWorld.app/Contents/Resources/main.py'. See console for errors.' 

What can I do to run it on 10.5? Why is this still the path / Users / hupf / Development / that I only have on my 10.6 machine?

Hi hupf

PS I also installed Python through MacPorts on my 10.6 computer ... maybe this is a problem?

+4
source share
1 answer

I donโ€™t know anything about PyObjC, but your project uses Xcode, then you just need to set the goal of deploying your project to the oldest version of the OS that you want your application to run. (FYI: the SDK version determines the latest version of the operating system on which the application will be run.) Please also note that any API added after the target deployment version will be loosely coupled, which means that if you are running on an older OS where these APIs does not exist, they will be zero; if you call them, you will fail. (therefore, you should always check them! = nil before calling).

Again, this is not necessarily PyObjC's answer; YMMV ...

0
source

Source: https://habr.com/ru/post/1299249/


All Articles