On Apr 24, 2009, at 8:47 PM, Jon Gordon wrote:
On Apr 24, 2009, at 4:40 PM, Jason Foreman wrote:

On Apr 23, 2009, at 7:37 PM, Jon Gordon wrote:
But I understand (I think) also that, in a Core Data document- based application, the application delegate is set to one provided by Core Data. And in such cases, providing my own delegate breaks Core Data functionality that I'd otherwise get for free.

The Core Data Application Xcode template does create an class that is hooked up as the application delegate. However you are certainly free to add code to it or replace it with your own delegate, as long as your delegate also provides the functionality that the generated template delegate does (setting up Core Data stack, etc). The default delegate isn't so much "provided by Core Data" as it is "an default generated for you by Xcode."

Thanks for the reply. I've seen this information about the existence of the default delegate elsewhere, but I can't seem to find any information about the delegate itself. Indeed, whenever I ask NSApp what the delegate is (by using NSLog and [NSApp delegate]), it reports that the delegate is null. I've tried searching the docs and Googling the Web, to no avail. Do you know of any documentation for this?

I haven't used Core Data, but I see there are two Xcode templates that give you different things. If you create a "Core Data *Document- based* Application", no app delegate is created for you. If you create a "Core Data Application", an app delegate class is created and you can see the .h and .m files in Xcode. Anything you read about a delegate being created for you was probably referring to the latter case.

--Andy


_______________________________________________

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