Bindings / CoreData / two windows issue
Bindings / CoreData / two windows issue
- Subject: Bindings / CoreData / two windows issue
- From: Timothy Reaves <email@hidden>
- Date: Sun, 4 Dec 2005 12:08:49 -0500
I have a fairly simple app, with two windows. The main window has a
table view that when double-clicked, will open the item in a separate
window to edit. The first time an entry is double-clicked, a window
controller is created and put into a dictionary, so that subsequent
double-clicks will retrieve the existing controller and open that.
My problem is that the first time the code is run, the window does
not open, and instead I get this error in my log:
2005-12-03 19:31:59.644 Editor[7864] *** -[_NSControllerObjectProxy
copyWithZone:]: selector not recognized [self = 0x49723a0]
2005-12-03 19:31:59.644 Editor[7864] *** NSRunLoop ignoring exception
'*** -[_NSControllerObjectProxy copyWithZone:]: selector not
recognized [self = 0x49723a0]' that raised during posting of delayed
perform with target 38e4c0 and selector 'invokeWithTarget:'
The second time the code is run (where I simply see if the controller
has been added to the cache instead of creating a new one), it opens
and works fine.
I've searched the archives for the error message, and saw where
mmalc thought it might have to do with a copy instead of a retain
being used on one of the controllers or in a bind: method. I've
looked at all my code, and am not using copy. I do use retain.
The code I use is:
BookWindowController *windowController = [[self bookEditorCache]
objectForKey:[object objectID]];
if (windowController == nil) {
windowController = [self createCachedEditorForBook:(Book *)
object];
}
// show the window
[windowController showWindow:self];
In stepping through the code, the exception is raised when
showWindow: is called. So the two different paths are just based
around windowController being nil. I just do not understand why the
first time the window is tried to be displayed I'd get the exception,
and not on subsequent times of opening the window. Especially as the
window seems to behave properly.
Any ideas?
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden