UIApplicationMain

Discussion in 'iOS Development' started by acca2o, Oct 15, 2009.

  1. acca2o

    acca2o New Member

    Joined:
    Sep 26, 2009
    Messages:
    51
    Likes Received:
    0
    Device:
    2G iPod touch
    I know...it' the basic...but i need to understand...

    Reading on Internet I understood that UIApplicationMain is a function that create an istance of the the two classes specified in the last two parameters.

    What's the difference bitween the principalClass and the delegateClass?
    What about if I specify both the parameters?
    Is it rigth than as the two objects are instantiated the applicationDidFinischLauncing message is sent them?

    What about the two parameters of the main (argc and argv)? how can I use them? what their meaning? what about them inside applicationDidFinischLauncing?


    Thanks a lot
  2. SkylarEC

    SkylarEC Super Moderator Emeritus Staff Member

    Joined:
    Sep 19, 2007
    Messages:
    6,642
    Likes Received:
    129
    The one class is the app delegate, the other class is the responder delegate. Typically, you'll set those to the same object. The exception would be if you /want/ different objects for each, or if you are using nibs.

    The arguments main accepts are mostly used for command line. UI applications can be configured to use them, but their usage in UI iPhone applications is exceedingly rare. It's best to ignore those.
  3. acca2o

    acca2o New Member

    Joined:
    Sep 26, 2009
    Messages:
    51
    Likes Received:
    0
    Device:
    2G iPod touch
    sorry for my stupidity

    Please Register or Log in to view images


    but I don'tunderstand the difference, or better, what the delegate and the respoder delegate do.
    Can you try to explain me better by an example?
    tk
    p
  4. SkylarEC

    SkylarEC Super Moderator Emeritus Staff Member

    Joined:
    Sep 19, 2007
    Messages:
    6,642
    Likes Received:
    129

Share This Page