全局变量
AppDelegate可以在整个应用程序中调用,在其他页面中可以使用代码段获取AppDelegate的全局变量:AppDelegate *appDelegate=[[UIApplication sharedApplication] delegate];
因此可以在AppDelegate.h中定义需要全局使用的变量。
全局变量
AppDelegate可以在整个应用程序中调用,在其他页面中可以使用代码段获取AppDelegate的全局变量:AppDelegate *appDelegate=[[UIApplication sharedApplication] delegate];
因此可以在AppDelegate.h中定义需要全局使用的变量。