PyObjC 1.2 Released
PyObjC v1.2 is now available. You can grab it from the sourceforge download page or from my idisk.
The major changes are listed below. There is some seriously cool stuff in here; new packaging, support for pure-python loadable NSBundles, categories, better bridging of complex types, and revamped examples.
PyObjCTools.AppHelper.stopEventLoopwill attempt to stop the current
NSRunLoop(if started byrunConsoleEventLoop) or terminate the
currentNSApplication(which may or may not have been started by
runEventLoop).- This version no longer support Python 2.2. Python 2.3 or later is
required. - It is now possible to use
reloadon modules containing Objective-C
classes. objc.loadBundlenow returns bundle we just loaded.- Added
objc.loadBundleVariablesandobjc.loadBundleFunctions,
two functions for reading global variables and functions from a bundle. - objc.runtime will now raise AttributeError instead of objc.nosuchclass_error
when a class is not found. - objc.Category can be used to define categories on existing classes:
class NSObject (objc.Category(NSObject)): def myMethod(self): passThis adds method
myMethodto class NSObject. py2appis now used for all Example scripts and is the recommended method
for creating PyObjC applications.- Proxies of dict, list, and tuple now respect the invariant that you should
get an identical instance if you ask for the same thing twice and the
collection has not been mutated. This fixes some problems with binary
plist serialization, and potentially some edge cases elsewhere. - There is now a
__bundle_hack__class attribute that will cause the PyObjC
class builder to use a statically allocated class wrapper if one is
available via certain environment variables. This functionality is used
to enable +[NSBundle bundleForClass:] to work for exactly one class from
a py2app-created plugin bundle. - We now have a working Interface Builder palette example due to
__bundle__hack__. bool(NSNull.null())is now false.setup.pysupports several new commands:* build_libffi builds libffi (used by build_ext) * build_html builds html documentation from ReST source * bdist_dmg creates a disk image with the binary installer * bdist_mpkg creates a binary installer * test runs unit test suite (replaces Scripts/runPyObjCTests and Scripts/runalltests)
PyObjCStrBridgeWarningcan now be generated when Pythonstrobjects
cross the bridge by callingobjc.setStrBridgeEnabled(False). It is
HIGHLY recommended that your application never sendstrobjects over
the bridge, as it is likely to cause problems due to the required
coercion to unicode.- The coercion bridge from Python to Objective-C instances can now be
augmented from Python as it is exposed byOC_PythonObject. See
objc._bridges. This is how thestr->unicode->NSString
bridge with optional warnings is implemented. - The coercion bridge between Python objects and Objective-C structures
can now be augmented from Python as it is exposed byOC_PythonObject.
Seeobjc._bridges. This is how theCarbon.File.FSRef
<->‘{FSRef=[80c]}’structure bridge is implemented. - Extension modules such as
_objc,_AppKit, etc. are now inside
packages asobjc._objc,AppKit._AppKit, etc. They should never be
used directly, so this should not break user code.

