Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cocoa Application Bootstrap Questions [closed]

I am an experienced developer, new to Mac development, so I

  • Read a nice objective C guide
  • Read the Apple memory management guide
  • Went through the Apple intro to Cocoa
  • Checked out the NSApplication and NSApplicationDelegate Refs
  • Messed around a bit

There are still lots of gaps, and I'm having a hard time finding good readables. Some of my questions are listed below. These are very simple/general. There must be a short, concise doc that details the basic app bootstraping process, and all involved classes. Thanks!

  • The "delegate" that gets generated by XCode contains instances of NSPersistentStoreCoordinator, NSManagedObjectModel, and NSManagedObjectContext -- details please?
  • The delegate is declared "@interface tests_AppDelegate : NSObject {" . Why is the protocol missing? I see examples on the net with it there.
  • I see that the application delegate is instantiated inside Interface Builder. Where is it passed into the NSApplication instance?
like image 742
kelf Avatar asked Nov 06 '22 10:11

kelf


1 Answers

The "delegate" that gets generated by XCode contains instances of NSPersistentStoreCoordinator, NSManagedObjectModel, and NSManagedObjectContext -- details please?

That's Core Data stuff.

The delegate is declared "@interface tests_AppDelegate : NSObject {" . Why is the protocol missing? I see examples on the net with it there.

Probably an oversight. AppKit didn't always have a formal NSApplicationDelegate protocol. It's possible that Apple simply never updated the templates. You might file a bug.

I see that the application delegate is instantiated inside Interface Builder. Where is it passed into the NSApplication instance?

Right-click on the application object. You'll find that its delegate outlet is connected to the delegate object.

like image 171
Peter Hosey Avatar answered Nov 11 '22 02:11

Peter Hosey