views:

172

answers:

2

I built a custom control and an IB plugin for it. If I run the plugin using IB as a custom executable from the plugin project everything works like a champ. But if I copy the framework and plugin to the "normal places", create a test app for it, and run the simulator - IB crashes after it returns from the simulator. I've scoured the web and the docs, but I can't find anything on these methods. Any idea what I'm missing? (by the way, the framework is in /Library/Frameworks, and the plugin is in /Developer/Platforms/MacOSX.platform/Developer/Library/Interface Builder/Plugins). Here's the stack from IB's crash report:

Assertion Message: No object for "IBResizeActionInitialFrame" key.

Backtrace:
0. Interface Builder 0x00004d29 [IBApplication handleAssertion:inFile:onLine:]
1. InterfaceBuilderKit 0x002c74ee [IBLibraryController createDetailedDescriptionFromTemplate:]
2. InterfaceBuilderKit 0x003aad22 [NSView lastResizeAction]
3. Foundation 0x90b98a7a [NSObject valueForKey:]
4. Foundation 0x90bc65fa [NSObject valueForKeyPath:]
5. InterfaceBuilderKit 0x0043cec6 [IBResourceManager document]
6. InterfaceBuilderKit 0x0043d6f9 [IBResourceManager document:willSynchronizeWithProjectFiles:project:]
7. InterfaceBuilderKit 0x002dfdae [IBDocument willSynchronizeWithProjectFiles:project:]
8. InterfaceBuilderKit 0x002df00a [IBDocument beginSyncingWithXcodeIfNeeded]
9. Foundation 0x90baa22e [NSRunLoop runMode:beforeDate:]
10. CoreFoundation 0x932d6b25 CFRunLoopRunSpecific
11. CoreFoundation 0x932d6cd8 CFRunLoopRunInMode
12. HIToolbox 0x92f622c0 BlockUntilNextEventMatchingListInMode
13. HIToolbox 0x92f620d9 BlockUntilNextEventMatchingListInMode
14. HIToolbox 0x92f61f4d BlockUntilNextEventMatchingListInMode
15. AppKit 0x95229d7d _DPSNextEvent
16. AppKit 0x95229630 [NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:]
17. Interface Builder 0x0000276b [IBApplication nextEventMatchingMask:untilDate:inMode:dequeue:]
18. AppKit 0x9522266b [NSApplication run]
19. AppKit 0x951ef8a4 NSApplicationMain
20. Interface Builder 0x00004eca [IBApplication changeInspectorMode:]

+1  A: 

Ok, here's the answer to my own question: If you override ibDidAddToDesignableDocument, you must call super. Once I did this, the assertion problem is fixed. Hope this helps someone else.

Sean Rich
A: 

Thanks for the hint, I had that exception for weeks before reading your post. This seems have fixed my problem.

ybart