XCode 4 / Universal App understand

Discussion in 'iOS Programming' started by grangej, Feb 20, 2011.

  1. grangej macrumors newbie

    Feb 20, 2011
    Ok I am trying to wrap my head around this universal app setup. I need to have some code load for both iphone/ipad outside of the AppDelegate, how would I load this without duplicating the code in both the iphone and ipad versions?

    I have a TabBarController and need to load some code before this is loaded completely.
  2. dejo Moderator


    Staff Member

    Sep 2, 2004
    The Centennial State
    You could have each side's app delegate call the same, single piece of code (a concept known as code reuse).
  3. grangej thread starter macrumors newbie

    Feb 20, 2011
    I think perhaps I might be over thinking this whole MVC thing.

    I was thinking of more duplicating the shared AppDelegate structure apple is using in there template (an app delegate that inherits from a shared app delegate and overrides what is necessary, basically doing something similar with the rootViewController but my disconnect is happening with the tabbarcontroller, It seems to want to be connected to the appDelegate not a separate controller like I would like, am I missing something?

Share This Page