• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Core Data and the Application Delegate
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Core Data and the Application Delegate


  • Subject: Re: Core Data and the Application Delegate
  • From: Jon Gordon <email@hidden>
  • Date: Fri, 24 Apr 2009 20:44:20 -0400

I believe it to be so because of some things I found while Googling to look for the answer. I even found one poster to some list who claimed that his Core Data app worked perfectly well until he set his own application delegate, at which point it stopped working perfectly well.

On the other hand, though, I have put

    NSLog(@"delegate: %@", [NSApp delegate]);

statements at various points in my code, which is based on the Document-Based Core Data application template, and it always reports a null application delegate. So now I'm full-on confused.

Thanks for the reply, though.

	-Jon

On Apr 24, 2009, at 3:27 PM, Sean McBride wrote:

On 4/23/09 8:37 PM, Jon Gordon said:

I'm having trouble understanding how to do certain things with the
application delegate in a document-based application that uses Core
Data. Or maybe I'm understanding things perfectly well, but I don't
like the logical conclusion.  But I digress.

In a normal (i.e., non-Core Data) document-based application, as I
understand it, one can modify certain functions by providing a
delegate to the instance of NSApplication. For example, to keep the
application from opening a blank document at launch, I can have a
delegate that implements applicationShouldOpenUntitledFile: and always
returns NO.


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.

Am I right about this?

I don't believe so. Why do you believe this? In any case, you can check yourself by asking NSApplication what its delegate is.

--
____________________________________________________________
Sean McBride, B. Eng                 email@hidden
Rogue Research                        www.rogue-research.com
Mac Software Developer              Montréal, Québec, Canada



_______________________________________________

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


References: 
 >Core Data and the Application Delegate (From: Jon Gordon <email@hidden>)
 >Re: Core Data and the Application Delegate (From: "Sean McBride" <email@hidden>)

  • Prev by Date: Re: NSPopUpButtonCell causes UI to "sleep" when clicked
  • Next by Date: Re: Core Data and the Application Delegate
  • Previous by thread: Re: Core Data and the Application Delegate
  • Next by thread: Re: Core Data and the Application Delegate
  • Index(es):
    • Date
    • Thread