_NSKeyValueObservationInfoGetForwarderForObserver - NSTextField bindings
_NSKeyValueObservationInfoGetForwarderForObserver - NSTextField bindings
- Subject: _NSKeyValueObservationInfoGetForwarderForObserver - NSTextField bindings
- From: Pierre Bernard <email@hidden>
- Date: Mon, 9 Jul 2007 23:09:26 +0200
Hi!
I am again having a memory management bug with Cocoa bindings. Boy do
I hate those. I still have found no way to reliably debug these.
The console output and stack trace are below. Here are the facts:
- Document based CoreData application
- 3 NSArrayControllers created in the NIB
- A NSTableView with bindings to one of the array controllers
- A couple of NSTextFields with bindings to said array controllers
The problem is with the text fields. When I remove those from the NIB
all is fine.
Now why does a text field bound to an array controller get to the
document to which it has no obvious relationship?
2007-07-09 22:49:30.266 HoudahGeo[1032] Document.m:1063 ************
DEALLOC ***************
2007-07-09 22:49:30.329 HoudahGeo[1032] *** Selector 'isKindOfClass:'
sent to dealloced instance 0x36cd80 of class Document.
Break at '-[_NSZombie methodSignatureForSelector:]' to debug.
2007-07-09 22:49:30.329 HoudahGeo[1032] *** -[NSAutoreleasePool
dealloc]: Exception ignored while releasing an object in an
autorelease pool: *** Selector 'isKindOfClass:' sent to dealloced
instance 0x36cd80 of class Document.
Break at '-[_NSZombie methodSignatureForSelector:]' to debug.
#0 0x928d68b4 in -[_NSZombie methodSignatureForSelector:]
#1 0x927fa2f4 in -[NSObject(NSForwardInvocation) forward::]
#2 0x90a5ccc1 in _objc_msgForward
#3 0x928c04e0 in _NSKeyValueObservationInfoGetForwarderForObserver
#4 0x928986bf in -[NSObject(NSKeyValueObserverRegistration)
removeObserver:forKeyPath:]
#5 0x93534f02 in -[NSController removeObserver:forKeyPath:]
#6 0x9351004a in -[NSBinder _updateObservingRegistration:]
#7 0x937cd1a1 in -[NSBinder
releaseConnectionWithSynchronizePeerBinders:]
#8 0x937d4f92 in -[NSValueBinder
releaseConnectionWithSynchronizePeerBinders:]
#9 0x932b23c5 in -[NSObject(_NSBindingAdaptorAccess)
_releaseBindingAdaptor]
#10 0x932b149a in -[NSView _finalize]
#11 0x932b0eb4 in -[NSView dealloc]
#12 0x93368f0d in -[NSControl dealloc]
#13 0x9340a98e in -[NSTextField dealloc]
#14 0x9329ea67 in -[NSView release]
#15 0x927d88cf in NSPopAutoreleasePool
#16 0x9328be28 in -[NSApplication run]
#17 0x9327fd2f in NSApplicationMain
#18 0x000063c5 in main at main.m:13
The relevant code is:
- (void) close
{
[[NSUserDefaultsController sharedUserDefaultsController]
removeObserver:self forKeyPath:nil];
[[NSNotificationCenter defaultCenter] removeObserver:self name:nil
object:nil];
[imageArrayController removeObserver:self forKeyPath:nil];
documentWindow = nil;
[super close];
}
- (void) dealloc
{
MLogString(@"************ DEALLOC ***************");
[super dealloc];
}
Your input is greatly appreciated!
Best,
Pierre Bernard
Houdah Software s.à r.l.
---
Pierre Bernard
http://www.bernard-web.com/pierre
http://www.houdah.com
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden