您的位置:首页 > 移动开发

UIApplicationMain

2013-01-12 22:49 351 查看

UIApplicationMain

This function is called in the
main
entry point to create the application object and the application delegate and set up the event cycle.
int UIApplicationMain (
   int argc,
   char *argv[],
   NSString *principalClassName,
   NSString *delegateClassName
);
ParametersargcThe count of arguments in argv; this usually is the corresponding parameter to
main
.argvA variable list of arguments; this usually is the corresponding parameter to
main
.principalClassNameThe name of the
UIApplication
class or subclass. If you specify
nil
,
UIApplication
is assumed.delegateClassNameThe name of the class from which the application delegate is instantiated. If principalClassName designates a subclass of
UIApplication
, you may designate the subclass as the delegate; the subclass instance receives the application-delegate messages. Specify
nil
if you load the delegate object from your application’s main nib file.Return ValueEven though an integer return type is specified, this function never returns. When users exits an iOS application by pressing the Home button, the application moves to the background.DiscussionThis function instantiates the application object from the principal class and and instantiates the delegate (if any) from the given class and sets the delegate for the application. It also sets up the main event loop, including the application’s run loop, and begins processing events. If the application’s
Info.plist
file specifies a main nib file to be loaded, by including the
NSMainNibFile
key and a valid nib file name for the value, this function loads that nib file.Despite the declared return type, this function never returns.
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: