Register FAQ / Rules Forum Spy Search Today's Posts Mark Forums Read
Go Back   MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Reply
 
Thread Tools Search this Thread Display Modes
Old Oct 25, 2009, 08:42 PM   #1
GorillaPaws
macrumors 6502a
 
GorillaPaws's Avatar
 
Join Date: Oct 2003
Location: Richmond, VA
Outline of what Apple does when your app is launched?

I'm wondering if there's a resource where you can see exactly what happens when your app launches. I have a rough idea about several of the big steps (applicationDidFinnishLaunching, awakeFromNib etc.), but I would love to find an article/reference that goes literally step-by-step through the process of all the initial setup in a standard cocoa app.

The reason I started thinking about this is I've been reading "Cocoa Design Patterns" which is quite excellent. In the notifications chapter I came across the line:

Quote:
Every thread in a Cocoa application has a default notification queue
It made me realize that there must be dozens of other objects that Apple is creating for me that I have know idea exist, and it would be interesting to see exactly what gets created when in the timeline. Does anyone know of a resource that documents this process?
__________________
How to ask good programming questions: Getting Answers
GorillaPaws is offline   0 Reply With Quote
Old Oct 26, 2009, 03:01 AM   #2
Cromulent
macrumors 603
 
Cromulent's Avatar
 
Join Date: Oct 2006
Location: The Land of Hope and Glory
The simplest method to finding out what is being run below your application code is to just get the debugger out and step into some Cocoa functions. Eventually you'll get down to the C level stuff and then into Assembly.

Frankly I was amazed when I compared some C programs with a test Objective-C program and the amount of crap that gets run behind the scenes.
__________________
Neural Advance - Mac OS X, UNIX and Windows Development
Last.fm Profile | Extreme Metal Reviews
MP 4x 2.66Ghz Xeons / 6GB RAM / 640GB + 500GB + 750GB + 1TB HDDs / ATI Radeon 4870 / iPad 3
Cromulent is offline   0 Reply With Quote
Old Oct 26, 2009, 09:56 AM   #3
Catfish_Man
macrumors 68030
 
Catfish_Man's Avatar
 
Join Date: Sep 2001
Location: Portland, OR
Send a message via AIM to Catfish_Man
Somewhat easier than just stepping through things in gdb would be to use dtrace and/or Instruments to watch calls and allocations.
Catfish_Man is offline   0 Reply With Quote
Old Oct 26, 2009, 10:17 AM   #4
lee1210
macrumors 68040
 
lee1210's Avatar
 
Join Date: Jan 2005
Location: Seattle, WA
The first, and likely only, thing you do in your main function in a Cocoa app is call NSApplicationMain:
http://developer.apple.com/mac/libra...pplicationMain

From there, the most "interesting" piece is loading of the main nib. This page has some information about what happens when you do this:
http://developer.apple.com/mac/libra...00051i-CH4-SW8

Stepping through things, watching calls, etc. will certainly be of value/interest but i thought it might be of value to read the documents that detail the process so you have some of the high-level knowledge about the design as well as the low-level knowledge of the actual calls that go on.

-Lee
lee1210 is offline   0 Reply With Quote
Old Oct 28, 2009, 07:03 PM   #5
GorillaPaws
Thread Starter
macrumors 6502a
 
GorillaPaws's Avatar
 
Join Date: Oct 2003
Location: Richmond, VA
Thanks for your replies. I was hoping there'd be more info/easier to access than using dtrace or the debugger. I also found this article which didn't have all the detail I was hoping for but was helpful as a general overview. Hopefully someone finding this thread in a search will find it useful.
__________________
How to ask good programming questions: Getting Answers
GorillaPaws is offline   0 Reply With Quote

Reply
MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
thread Thread Starter Forum Replies Last Post
New iPhone App - CollisionCare - What to do when you are in an accident dpk2019 iPhone and iPod touch Apps 1 Nov 24, 2011 02:09 PM
Ipad will only sync and fetch when app is launch jamesberryjames iPad 3 Sep 17, 2011 01:27 PM
OK, your app is on the Mac App Store. Now what ? monsieurpaul Mac Programming 4 Mar 22, 2011 07:59 PM
Code when the app is launched Blakeasd Mac Programming 4 Jul 19, 2010 07:33 AM
When your blood is boiling because of your family. mymemory Community 4 May 16, 2005 08:23 AM


All times are GMT -5. The time now is 04:48 PM.

Mac Rumors | Mac | iPhone | iPhone Game Reviews | iPhone Apps

Mobile Version | Fixed | Fluid | Fluid HD
Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

Privacy / DMCA contact / Affiliate and FTC Disclosure
Copyright 2002-2013, MacRumors.com, LLC