Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- You can put your widget class as a property on the Application Delegate.
- @interface youAppDelegate : NSObject <UIApplicationDelegate> {
- Widget *myWidget;
- }
- @property (readonly) Widget *myWidget;
- @end
- Then, instantiate it on the message "applicationDidFinishLaunching" of your application's delegate.
- Once you've done that, you can access myWidget from anywhere in the project like this:
- youAppDelegate *ad = (youAppDelegate*)[UIApplication sharedApplication].delegate;
- Widget *w = [ad myWidget];
- That code can be perfectly compiled and executed at viewController1, viewController2 or even on the tabBarController.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement