Here's a question (and good answers) about singletons.
You could also use the app delegate, as frankodwyer suggested, and access it from anywhere using:
id delegate = [[UIApplication sharedApplication] delegate];
For ease of use and type safety I use a category like this:
// put his in your delegate header file
@interface UIApplication(MyAppAdditions)
+ (MyAppDelegate*)sharedDelegate;
@end
// put his in your delegate implementation file
@implementation UIApplication(MyAppAdditions)
+ (MyAppDelegate*)sharedDelegate {
return (MyAppDelegate*)[[self sharedApplication] delegate];
}
@end
Now you can access your app delegate from everywhere: [UIApplication sharedDelegate]