When developing for the Mac or the iPhone we frequently run into the situation of needing to grab the delegate. Thankfully this is stored in a singleton object and very easy to fetch:
1 2 3 | #import "MyAppDelegate.h" ... MyAppDelegate *delegate = [[UIApplication sharedApplication] delegate]; |