Interface Builder Plugin Image inspector property problem on load
Everything works fine in runtime image changing. But nothing is loaded when i save and load xib file.
here is the simplified code:
IBDocument *document = [IBDocument documentForObject:self];
[self->defaultImage release];
self->defaultImage = [document documentImageNamed:aImage];
[self->defaultImage setName:aImage];
[self->defaultImage ret开发者_如何学Pythonain];
The [document documentImageNamed:aImage]
returns an NSImage in runtime, but when loading from file it return nil
though the NSImageWell works fine in runtime and when initialized from coder.
What i'm missing?
Thans.
You must implement NSCoding protocol for you custom object. http://developer.apple.com/library/mac/#documentation/Cocoa/Reference/Foundation/Protocols/NSCoding_Protocol/Reference/Reference.html
精彩评论