I'm coding my first app in XCode 4.2 supporting iOS 4.x through the current releases. To support iOS 4.0, I'm not using Storyboard feature and also using unsafe_unretained
for weak references. I have AppDelegate files (.h and .m) along with several view controllers with UITabBarController
. In my first view controller, in the -viewDidLoad
method, I initialize two NSDictionaries
and also start a timer with 1 sec interval. In the selector method, I have to pickup a random number between 0 and 7 to pick a corresponding value in both the dictionaries. The dictionaries are used only in the first view controller and not anywhere.
My first question is
- where do I load those two dictionaries - in the AppDelegate
-didFinishLaunchingWithOptions:
method or in the first view controller's-viewDidLoad
method? - I also wanted to support iPad. If that's the case, do I create a common class library to support iPhone/iPod/iPad?. If that is the recommended way, can I move the common functionality to the AppDelegate .m file instead?
Please advise.