1

I'm restoring an old project to work on ios 4.3 - latest build (6.0) I understand that AppDelegate and AppController on a basic level perform about the same tasks.

Basically, is there more to AppDelegate than the name to warrant a change?

user1779598
  • 51
  • 1
  • 10
  • 1
    Do you mean the name of the class? As long as it inherits from UIApplicationDelegate, it doesn’t matter what it’s called. Or is AppController a different class? – Zev Eisenberg Jan 24 '13 at 20:04
  • 1
    Good question. It inherits from NSObject and applies to UIApplicationDelegate where as in ios 6 projects they inherit from UIResponder – user1779598 Jan 24 '13 at 20:36
  • 1
    Oops, guess I should have looked at some actual code instead of doing it from memory. You should probably update it to `UIResponder ` or, better yet, create a new project, get the new app delegate, and replace your old one. Here’s a [speculation](http://stackoverflow.com/questions/6893221/why-does-appdelegate-inherit-from-uiresponder) as to why new app delegates inherit from `UIResponder` by default. – Zev Eisenberg Jan 24 '13 at 20:40
  • 2
    The delegate and a controller ***are not the same and do not perform the same functions***. Controllers manage, delegates delegate. – CodaFi Jan 24 '13 at 21:55
  • @CodaFi +1, but it's more accurate to say that delegates perform tasks that have been delegated to them in order to customize the behavior of the class whose delegate they are. It's not necessary, or always desirable for the main application controller (if there is one) to also be the application delegate. However, it does often make sense for them to be one and the same. – Andrew Madsen Jan 24 '13 at 22:35
  • @AndrewMadson While that is necessarily true, on iOS, delegates are literally delegates. They're the first thing (aside from main) that's notified of launch, and the last thing notified of a quit (again, besides main). As for the second half, I wholeheartedly disagree. Delegate and controller logic mixing should be used sparingly, if at all (preferably the if at all part). If one has no other choice, then the combination makes sense, otherwise it's just an inability or an unwillingness to subclass NSObject and shove your logic in there. – CodaFi Jan 25 '13 at 01:02

0 Answers0