Hi,
 I'm writing my first Cocoa app and have come across a problem in trying
to implement an Inspector window within a Document-based application. I
found an example of this at

http://homepage.mac.com/mmalc/CocoaExamples/controllers.html

in the BindingsDocumentInspector.zip project which is based on Apple's own
TextEdit example in /Developer/Examples/AppKit. I was able to get the
inspector working only when the inspector panel gui controls (Text Fields)
are bound to number types, e.g. NSInteger. If I bind a field to an
NSString*, launch my app, open a document window, then open the controller
window, the app will crash, either immediately or within a few window
clicks. It crashes in the inspector panel controller class's
activeDocumentChanged method where it tries to set the value of the
inspected document key to the document.

At least initially, my inspector panel is only going to display various
document attributes and will not be a source of changes.

I thought the crashes might have something to do with the way I'm
initializing the NSString*'s but I don't think that's the problem.
Since I modeled this part of my program on the example project above, I've
gone through Interface Builder in both xib's making sure that everything
is connected/bound/right-click-dragged in the same way.

I'd be grateful for any pointers in tracking this down!

Ryan

(gdb) bt
#0  0xfffeff18 in ?? ()
#1  0x95355c18 in objc_getProperty ()
#2  0x00003b3c in -[MyDocument docName] (self=0x173e80, _cmd=0x5eec) at 
/Users/ryan/proj/NW/MyDocument.m:364
#3  0x95e408e0 in -[NSObject(NSKeyValueCoding) valueForKey:] ()
#4  0x95e686dc in -[NSObject(NSKeyValueCoding) valueForKeyPath:] ()
#5  0x95e686a8 in -[NSObject(NSKeyValueCoding) valueForKeyPath:] ()
#6  0x93a64d48 in -[NSBinder 
_valueForKeyPath:ofObject:mode:raisesForNotApplicableKeys:] ()
#7  0x93a64904 in -[NSBinder valueForBinding:resolveMarkersToPlaceholders:] ()
#8  0x93a96414 in -[NSValueBinder 
_adjustObject:mode:observedController:observedKeyPath:context:editableState:adjustState:]
 ()
#9  0x93a960b0 in -[NSValueBinder _observeValueForKeyPath:ofObject:context:] ()
#10 0x93a97824 in -[NSTextValueBinder 
_observeValueForKeyPath:ofObject:context:] ()
#11 0x95e305dc in -[NSObject(NSKeyValueObservingPrivate) 
_notifyObserversForKeyPath:change:] ()
#12 0x938b946c in -[NSController _notifyObserversForKeyPath:change:] ()
#13 0x93d5a900 in -[NSObjectController setContent:] ()
#14 0x93d5fe74 in -[NSObjectDetailBinder refreshDetailContent] ()
#15 0x95e1ed90 in -[NSObject(NSKeyValueObserverNotification) 
didChangeValueForKey:] ()
#16 0x95e3ef88 in -[NSObject(NSKeyValueCoding) setValue:forKey:] ()
#17 0x000055f0 in -[NWInspectorPanelController activeDocumentChanged] 
(self=0x10e430, _cmd=0x6cd8) at 
/Users/ryan/proj/NW/NWInspectorPanelController.m:97
#18 0x00005924 in -[NWInspectorPanelController windowDidLoad] (self=0x10e430, 
_cmd=0x95400960) at /Users/ryan/proj/NW/NWInspectorPanelController.m:152
#19 0x9392d42c in -[NSWindowController _windowDidLoad] ()
#20 0x938d5b34 in -[NSWindowController window] ()
#21 0x00005ac4 in -[NWInspectorPanelController toggleInspectorPanel:] 
(self=0x10e430, _cmd=0x6d7c, sender=0x128ec0) at 
/Users/ryan/proj/NW/NWInspectorPanelController.m:170
#22 0x9398c0e0 in -[NSApplication sendAction:to:from:] ()
#23 0x93a278a8 in -[NSMenu performActionForItemAtIndex:] ()
#24 0x93a275d8 in -[NSCarbonMenuImpl 
performActionWithHighlightingForItemAtIndex:] ()
#25 0x93a08d90 in AppKitMenuEventHandler ()
#26 0x94fd73cc in DispatchEventToHandlers ()
#27 0x94fd6564 in SendEventToEventTargetInternal ()
#28 0x94ff3464 in SendEventToEventTarget ()
#29 0x95028f00 in SendHICommandEvent ()
#30 0x9504f84c in SendMenuItemSelectedEvent ()
#31 0x9504f750 in FinishMenuSelection ()
#32 0x9502c414 in MenuSelectCore ()
#33 0x9502be28 in _HandleMenuSelection2 ()
#34 0x9395a9e0 in _NSHandleCarbonMenuEvent ()
#35 0x938d0540 in _DPSNextEvent ()
#36 0x938cfa14 in -[NSApplication 
nextEventMatchingMask:untilDate:inMode:dequeue:] ()
#37 0x938c96d0 in -[NSApplication run] ()
#38 0x9389a0d4 in NSApplicationMain ()
#39 0x00003cd4 in main (argc=1, argv=0xbffff6a8) at 
/Users/ryan/proj/NW/main.m:26
_______________________________________________

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 [EMAIL PROTECTED]

Reply via email to