On Aug 11, 2011, at 6:26 PM, cocoa-dev-requ...@lists.apple.com wrote:

> Hello,
>  I'm migrating my apps to the App Store and my projects to Xcode 4 and the 
> 10.6 SDK. Now my app is crashing when I try to load the window nib that 
> contains my preferences window. I'm getting infinite recursion as shown in 
> this sample of the stack trace. I take it this is a KVO problem but what kind 
> of error could I have made that this would only popup when linking with the 
> 10.6 SDK. The app ran fine previously under Lion, compiled with Xcode 3/10.5 
> SDK. Any tips would be appreciated.
> 
> #841  0x906d4679 in loadNib ()
> #842  0x906d3a60 in +[NSBundle(NSNibLoading) 
> _loadNibFile:nameTable:withZone:ownerBundle:] ()
> #843  0x906d396a in +[NSBundle(NSNibLoading) 
> loadNibFile:externalNameTable:withZone:] ()
> #844  0x908ce350 in -[NSWindowController loadWindow] ()
> #845  0x908ce0ee in -[NSWindowController window] ()
> #846  0x903ab16b in _NSGetUsingKeyValueGetter ()
> #847  0x903ab13c in -[NSObject(NSKeyValueCoding) valueForKey:] ()
> #848  0x903ccad5 in -[NSKeyValueNestedProperty 
> object:didAddObservance:recurse:] ()
> #849  0x90393c54 in -[NSObject(NSKeyValueObserverRegistration) 
> _addObserver:forProperty:options:context:] ()
> #850  0x903923ea in -[NSObject(NSKeyValueObserverRegistration) 
> addObserver:forKeyPath:options:context:] ()
> #851  0x906f3bdc in -[NSBinder _updateObservingRegistration:] ()
> #852  0x906f2b10 in -[NSBinder establishConnection] ()
> #853  0x906e5b67 in -[NSObject(NSKeyValueBindingCreation) 
> bind:toObject:withKeyPath:options:] ()
> #854  0x90902ed4 in -[NSNibBindingConnector establishConnection] ()
> #855  0x906de819 in -[NSIBObjectData 
> nibInstantiateWithOwner:topLevelObjects:] ()
> #856  0x906d4679 in loadNib ()
> etc...
> 
> 
> Thanks,
>  Philip White


I seemed to have found what is causing the problem here. I had an NSTabView's 
selectedIdentifier binding bound to File's 
Owner.window.toolbar.selectedItemIdentifier
Apparently this would cause a problem because it would call the window 
controller's -window method again, which would call -loadWindow again, and then 
proceed with all that nib loading business until it tried to make that same 
connection at which point it would all start over again.
This used to work just fine and I thought this was the standard way of 
connecting NSToolbars with NSTabViews. Must I connect this binding 
programmatically after the window loads?

Thanks,
  Philip

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to