1.在AppDelegate.h 中定義下面方法;
1 |
+(AppDelegate *) app; |
2.AppDelegate.m中,加入;
1 |
+ (AppDelegate*) app |
3 |
{ |
4 |
5 |
return (AppDelegate*)[[UIApplication sharedApplication] delegate]; |
6 |
7 |
|
1.在AppDelegate.h 中定義下面方法;
1 |
+(AppDelegate *) app; |
2.AppDelegate.m中,加入;
1 |
+ (AppDelegate*) app |
3 |
{ |
4 |
5 |
return (AppDelegate*)[[UIApplication sharedApplication] delegate]; |
6 |
7 |
|