混淆下面的代碼我上的Xcode 3.2使用,效果很不錯由ARC
@interface MoObject : UIViewController
{
NSMutableArray *categoryArray;
}
@property (nonatomic, retain) NSMutableArray *categoryArray;
@end;
@implementation MyObject
@synthesize categoryArray;
- (void)viewDidLoad
{
[super viewDidLoad];
NSMutableArray *a = [[NSMutableArray alloc] init];
categoryArray = a;
[a release]; //AAA:I can not release this, it does not report compiling error , but after some operation, it will cause exec bad error
}
- (void)dealloc {
[category release];
[super dealloc];
}
我剛剛轉會的Xcode 4.3.1的iOS 5.1
同樣的功能會導致如此多的高管的嚴重錯誤。
即使我關閉了整個項目的ARC。
的問題仍然存在,它看起來像我不能點AAA發行對象數組
歡迎任何評論
爲什麼在dealloc中釋放categoryArray?它保留在任何地方?這可能是問題。 – 2012-04-24 06:58:16
@property(nonatomic,retain)NSMutableArray * categoryArray; – arachide 2012-04-24 07:02:17