An overview of the relevant changes in new, and older, releases.
PyObjCTools.KeyValueCoding
provides a python interface that makes it
possible to use key-value coding with python objects as well as
Objective-C objects. Key-Value Coding also works as one would expect with
Python objects when accessing them from Objective-C (both for plain Python
objects and Python/Objective-C hybrid objects).description
method. This method is not called for unitialized objects,
because that might crash the interpreter; we use a default implementation
in that case.This is a backward incompatible change, but there are not many of such methods.
objc
module. The most significant of these is the change from
recycle_autorelease_pool
to recycleAutoreleasePool
. The other
changed names are internal to the bridge and should not be used in other
code.Two new tutorials were added: 'Adding Python code to an existing ObjC application' and 'Understanding existing PyObjC examples'. The former explains how you can use Python to add new functionality to an already existing Objective-C application, the latter explains how to understand PyObjC programs written by other people.
Three examples were added: DotView, ClassBrowser and PythonBrowser, respectively showing the use of a custom NSView, NSBrowser and NSOutlineView. PythonBrowser is reusable, making it trivial to add an object browser to your application.
It is now possible to build PyObjC on MacOS X 10.1, with full access to the Cocoa API's on that platform.
Note: The port to MacOS X 10.1 is not as well supported as the 10.2 port. The developers do not have full-time access to a MacOS X 10.1 system.
If you build PyObjC from source you will have to build on a system that has the WebKit SDK installed to make use of this. Note that the additional functionality will only be usuable on systems that have Safari 1.0 installed, however as long as you don't use the additional functionality it is safe to run a 'WebKit-enabled' PyObjC on systems without Safari 1.0.
a class, this information is automaticly deduced from the list of implemented methods. You'll still a runtime error if you implement some methods of a protocol and one of the unimplemented methods is required.
It is now possible to use instances of Carbon.CF types in places where Objective-C objects are expected. And to explicitly convert between the two.
Note: this requires Python 2.3.
NSMovie.initWithMovie_
and NSMovie.QTMovie
now use QT.Movie
objects instead of generic pointer wrappers.NSWindow.initWithWindowRef_
and Window.windowRef
now use
Carbon.Window
objects instead of generic pointer wrappers.pyobjcPopPool
and pyobjcPushPool
of NSAutoreleasePool
are deprecated. These were introduced when PyObjC did not yet support the
usual method for creating autorelease pools and are no longer necessary.NOTE: You could create weakrefs in previous versions, but those would expire as soon as the last reference from Python died, not when the Objective-C object died, therefore code that uses weakrefs to Objective-C objects is almost certainly incorrect.
objc.lookup_class -> objc.lookUpClass objc.selector arguments/attributes: is_initializer -> isInitializer is_allocator -> isAlloc donates_ref -> doesDonateReference is_required -> isRequired class_method -> isClassMethod defining_class -> definingClass returns_self -> returnsSelf argument_types -> argumentTypes return_type -> returnType objc.get_class_list -> objc.getClassList
o Adjusting Setup, commenting out NeXT definition and enabling GNU ones; o make -f Makefile.pre.in boot o make static
pyobjc
.((void *) 1)
.Class()
syntax. You
select the right initializer selector with the init
keyword parameter.framep = aView.getFrame__.pack_argument (0) aView.getFrame__ (framep) frame = aView.getFrame__.unpack_argument (0, framep)
-ObjC
to the importdl.o
build rule:importdl.o: importdl.c $(CC) -ObjC -c $(CFLAGS) -I$(DLINCLDIR) $(srcdir)/importdl.c
*shared*
, and remove -u libNeXT_s -lNeXT_s
from it.make
: this will update various files, in particular
Modules/Makefile.-u libNeXT_s -lNeXT_s
to SYSLIBS:SYSLIBS= $(LIBM) $(LIBC) -u libNeXT_s -lNeXT_s
make
again