对于旧版本的Xcode/IOS,我用:的AppDelegate访问
appDelegate =(AppDelegate *)[[UIApplication sharedApplication] delegate];
访问的AppDelegate
#import "AppDelegate.h"
@property (nonatomic,retain) AppDelegate *appDelegate;
#import <UIKit/UIKit.h>
@interface AppDelegate : UIResponder <UIApplicationDelegate> {
}
@property (strong, nonatomic) UIWindow *window;
@end
//-----
#import <UIKit/UIKit.h>
#import "AppDelegate.h"
@interface DetailController : UIViewController{
}
@property (nonatomic,retain) AppDelegate *appDelegate;
@end
但是从NSObject的iOS5中的AppDelegate变化UIRepsonder
是否有可能访问AppDelegate?
欢迎蚂蚁评论
它工作?或仍然出现错误? – 2012-04-07 05:19:04