UIApplication delegate


#1

On page 85, it says “For Whereami, the delegate of the UIApplication is the instance of WhereamiAppDelegate. (The template set this property for you.)”

I’m curious to know where the template set that. I see how we set the delegate of CLLocationManager to be WhereamiAppDelegate when we sent

but it’s not clear to me where UIApplication was told that WhereamiAppDelegate would be its delegate.

Thanks.


#2

This is declared in the interface.


#3

Hi,

http://developer.apple.com/library/ios/#documentation/iPhone/Conceptual/iPhone101/Articles/01_CreatingProject.html

Have a look at the Application Bootstrapping section to see how main.m, Info.plist, and MainWindow.nib all play a part in assigning the delegate.

Gareth


#4

[quote=“GarethR”]Hi,

http://developer.apple.com/library/ios/#documentation/iPhone/Conceptual/iPhone101/Articles/01_CreatingProject.html

Have a look at the Application Bootstrapping section to see how main.m, Info.plist, and MainWindow.nib all play a part in assigning the delegate.[/quote]

Thanks, Gareth. The short answer to my question is apparently “in the nib file”, which is the one place I didn’t look. If you look at the connnections inspector for File’s Owner (which is the instance of UIApplication), you can see that it has a delegate outlet set to WhereamiAppDelegate.

I found a similar article that has a little more detail on this topic under the “Defining the Application Delegate” section:
http://developer.apple.com/library/ios/#referencelibrary/GettingStarted/Creating_an_iPhone_App/_index.html%23//apple_ref/doc/uid/TP40007595

Thanks again,
Doug