Q: How can I define a cursor in IB? Just like for bitmaps, I do
myCursor = [Cursor findBitmapFor:"myCursor"];
and get back the bitmap; however, the bitmap is an instance of Bitmap and not of the Cursor class, so the [myCursor set] message results in an "Unrecognized Method" error.
A: This bug has been fixed in release 2.0. If you're still running release 1.0, read on.
The problem arises when IB creates bitmaps from the .nib file being loaded; the bitmaps are created as instances of Bitmap. When you invoke "findBitmapFor:," if the named bitmap already exists, you simply get a pointer to it. Unfortunately, when you call findBitmapFor: for Cursor, the same thing happens and you get a pointer to an instance of Bitmap. Cursor should override findBitmapFor: and do the right thing.
Two workarounds: One is to put the image in the __TIFF segment of your MachO,
rather than entering the image into your .nib file, and use newFromMachO: to read it in. Change your Makefile.preamble to create the new segment.
The other is to leave the Bitmap in your .nib file, and write the image into a Cursor object as follows. This way preserves the same Makefile(s) but at the expense of using additional memory for the Cursor object.