Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

rand0m3r

macrumors regular
Original poster
Jun 30, 2006
115
1
hi. say if i have a property inside my app delegate such as an int. how will i be able to access this property from another class?

i tried setting IBOutlet from my other classes to the App Delegate, but Interface Builder doesn't let me make the connection with ctrl + drag click.
 

admanimal

macrumors 68040
Apr 22, 2005
3,531
2
In Interface Builder, just make sure that you have an App Delegate object that is set as the File Owner's delegate. Then in the code you can use:

AppDelegate *appDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];

to get the AppDelegate and access its properties.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.