English 中文(简体)
如何操作Xcode?
原标题:How does Xcode pick which Python to run?
  • 时间:2010-12-14 01:52:05
  •  标签:
  • xcode
  • pyobjc

我使用Xcode的“灰尘”模板,有一个简单的项目,一个机器运行,另一个机器故障,原因不同。 我解决的失败是,即使主人:

Py_SetProgramName("/usr/bin/python");

从主食中可以看出,实际的山谷。 with:

import sys
print sys.version

is different. And the problem was that this other Python didn t have objc installed. So the question is: short of cleaning up my machine, how can I direct Xcode to use the system Python?

Edit:

This is a problem that seems like it is trivial, but it isn t. It seems so because when I specify Mac OS X 10.5 as the Base SDK, Xcode links against that Python.framework, as I can see by double-clicking the icon in Linked Frameworks in the Xcode project.

Each FCCC/SBI/2008/2。 框架具有关键/价值。 信息清单:CFBundleExecutableName/Python。 Luckily(用于法证)在2.5版框架发射2.6.1! 然而,通过印刷玩具(主机)转播,或通过在装货机上投放(通过出口DYLD_PRINT_LIBRAES=1),我可以看到PyObjC App 实际发射2.5.4。

上文与Py_SetProgramName的行文不相干,可以作评论,所有东西都可以做罚款。

因此,它所看的是沙尔。 启动的框架控制,它以我所期望的方式控制了这种控制,并且可能通过不公开的初始化常规加以控制,因为它由 Apple果控制。 看来,“控制”局势的最佳办法是改变后勤基地SDK。

最佳回答

回答我自己的问题,但我感到困惑。 这一部分是错误的。

第2.5版框架发射2.6.1

caused by my not realizing that what s going on here (from the Version/2.6 directory)

> ./Python
-bash: ./Python: cannot execute binary file
> Python
Python 2.6.1 (r261:67515, Jun 24 2010, 21:47:49) 

is that we re searching my $PATH and launching /opt/local/bin/python. Apologies for the confusion.

简言之,确定SDK应当获得所希望的“灰色”才能运行,正如我们能够看到的那样,在装载器上沉积:

> export DYLD_PRINT_LIBRARIES=1
> ~/Desktop/X/build/Debug/X.app/Contents/MacOS/X
dyld: loaded: /Users/telliott_admin/Desktop/X/build/Debug/X.app/Contents/MacOS/X
dyld: loaded: /System/Library/Frameworks/Cocoa.framework/Versions/A/Cocoa
dyld: loaded: /System/Library/Frameworks/Python.framework/Versions/2.5/Python
..
问题回答

暂无回答




相关问题
How to change out-of-focus text selection color in Xcode?

Okay, I ll bite. I ve got really pleasant code/window colors set up in Xcode. Ordinarily, my selection color is very visible. When I am doing a project search and iterating through the results, ...

Iphone NSTimer Issue

Hi I am new to objective c. I am trying to make an app for iphone. I have a button on my view, and the click on which the function playSound is called. This is working properly. It does plays the ...

Include a .txt file in a .h in C++?

I have a number of places where I need to re-use some template code. Many classes need these items In a .h could I do something like: #include <xxx.txt> and place all of this code in the ....

Iterating over string/strlen with umlauted characters

This is a follow-up to my previous question . I succeeded in implementing the algorithm for checking umlauted characters. The next problem comes from iterating over all characters in a string. I do ...

Xcode open two editor windows with same file

Is it possible to open the same file in two separate windows in Xcode. I can open a file in one window and the same file in the main Xcode editor window, but I wanted two separate fulltime editor ...

Forcing code signing refresh in Xcode

In our environment, we share resources across multiple projects and platforms. When building for iPhone, only a subset of those resources are needed. Since that subset is still considerable, we have ...

热门标签