IOS - ARC改为非ARC
1、project -> Build settings -> Apple LLVM complier 3.0 - Language -> objective-C Automatic Reference Counting设置为NO;
2、修改main.m
- @autoreleasepool {
- return UIApplicationMain(argc, argv, nil, NSStringFromClass([LTAppDelegate class]));
- }
修改为:
- NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
- int retVal = UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
- [pool release];
- return retVal;
3、修改AppDelegate
- @property (retain, nonatomic) UIWindow *window;
将strong修改为retain。
- -(void)dealloc
- {
- [_window release];
- [super dealloc];
- }