Core Data application types
Core Data application types
- Subject: Core Data application types
- From: "Mark Hill" <email@hidden>
- Date: Fri, 18 May 2007 17:24:09 +0100
I have a document-based core data application. I would like to
implement some sort of library browser table that will appear in each
instance of my document. Quartz Composer style.
I've done what appears to be a very crude thing and now I think I'm
paying for it. Here goes:
1. take one core data doc-based application X
2. add a new datamodel to doc-based X and call it Y_model
3. create a core data application called Y
4. add an "IBOutlet NSArrayController *yArrayController to Y's
delegate class and an accessor that returns an NSArray of
arrangedObjects.
5. import Y's Y_Delegate.h and .m files into project X.
6 DELETE core data application Y
7. Open mainmenu.nib of X and drag Y_Delegate into it and instantiate.
8. Set the application's delegate to Y_Delegate class.
Phew!
9. Open MyDocument.nib and create an NSArrayController
10. Set the class to NSApplication and bind it to [Shared
Application]delegate.yArrayController
11. bind a tableview to the arrangedObjects of NSArrayController with
a key path for the name attribute created in step 9.
This all works by the way. The contents of the mainmenu array appear
in the various document instances. There are no notifications taking
place at this stage, but I'm moving towards it.
My problem is (finally!) this error, which I get when I try to connect
a button in MyDocument.nib to NSArrayController that's bound to the
delegate:
2007-05-18 17:09:12.541 CoreDocGlutDataModel[16324] *** Assertion
failure in -[NSApplication init], AppKit.subproj/NSApplication.m:1023
2007-05-18 17:09:12.541 CoreDocGlutDataModel[16324] *** NSRunLoop
ignoring exception 'Creating more than one Application' that raised
during posting of delayed perform with target 160022f0 and selector
'invokeWithTarget:'
Any ideas?
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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