pyobjc / Doc / Xcode-Templates.html

<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">
<html xmlns="" xml:lang="en" lang="en">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
Python Xcode Templates</title>
<meta name="Author" content="Bill Bumgarner" />
<meta name="Contact" content="" />
<h2>Python Xcode Templates</h2>
<tbody valign="top">
<tr><th >Author:</th>
<td>Bill Bumgarner</td></tr>
<tr><th >Contact:</th>
<td><a href=""></a></td></tr>
<p>To use the project templates, simply copy (or link) them into the Project
Templates directory used by Xcode.  The Xcode templates are also
included in the PyObjC installer package.</p>
<li><a href="#notes" id="id1" name="id1">Notes</a></li>
<li><a href="#cocoa-python-templates" id="id2" name="id2">Cocoa-Python Templates</a></li>
<li><a href="#cocoa-python-application" id="id3" name="id3">Cocoa-Python Application</a></li>
<h2><a href="#id1" name="notes">Notes</a></h2>
<li>In all cases that involve loading frameworks or bundles, all of the classes
in that framework or bundle can be made available by using the
<code><span>loadBundle()</span></code> function in the <code><span>objc</span></code> module:<pre>
objc.loadBundle(&quot;MyFramework&quot;, globals(), bundle_path=&quot;/path/to/MyFramework.framework&quot;)
<p>This has the effect of importing all of the classes in the bundle or
framework into the current python scope's globals.  For all intents and
purposes, it is similar to:</p>
from Foundation import *
<li>There is risk that the pyobjc modules compiled for one version of python
will not work with another.  Where this may be a problem is if the a
standalone application is packaged with the pyobjc modules compiled
against, say, the Fink or Framework builds of Python, but is then executed
using the Apple supplied python binary.</li>
<li>The <i>Project Templates</i> directory includes a <strong></strong> script that
removes noise files from the project templates.   When working on project
templates, it is recommended that this script be invoked before creating a
test project from one of the templates.   For example, the presence of
user specific project builder settings will cause any projects created
from a template to be incorrect.</li>
<h2><a href="#id2" name="cocoa-python-templates">Cocoa-Python Templates</a></h2>
<p>The Cocoa-Python templates all create various different kinds of Cocoa
application projects.  Be sure and pick the correct project type for your
<h2><a href="#id3" name="cocoa-python-application">Cocoa-Python Application</a></h2>
<p>A project created from this template is designed to implement standalone,
pure-Python, applications that are compatible with Apple's build of Python as
well as all other builds of python that support PyObjC.</p>
<p>When building the 'install' target, the resulting application wrapper will
included the PyObjC module and can be launched on any stock Mac OS X 10.3
system without requiring PyObjC to be preinstalled.</p>