Проблем: Продължавам да получавам EXC_BAD_ACCESS. И след като отворя NSZombieEnabled, видях това [FeatureCommentListViewController respondsToSelector:]: съобщение, изпратено до освободен екземпляр 0x7c1dc30
Преди да променя проекта си на ARC, няма такава грешка, но след като смених на ARC, тази грешка се появи.
Декларирам ViewController в блок и го натискам в навигационния контролер. Дали тази причина ще доведе до по-кратък живот?
UIBlockButton е от тази публикация
UIBlockButton *lbGood3 = [[UIBlockButton alloc] initWithFrame:CGRectMake(0, 0, First_Button_Width, [self getGoodRow2Height:productDetail]) ]; [lbGood3 handleControlEvent:UIControlEventTouchUpInside withBlock:^ { NSLog(@"%@", Label.text); ProductDetail *productDetail = [productDetailDict objectForKey:@"product"]; NSString *dp_id = [NSString stringWithFormat:@"%@-%@",productDetail.url_crc,productDetail.site_id]; FeatureCommentListViewController *cmtListController = [[FeatureCommentListViewController alloc] initWithNibName:@"FeatureCommentListViewController" bundle:nil]; cmtListController.title = Label.text; cmtListController.isReviewed=isReviewed; cmtListController.productDetail=productDetail; cmtListController.dp_id=dp_id; cmtListController.feature_name = @"&feature_good_id=2"; [self.navigationController pushViewController:cmtListController animated:YES]; }];
Трябва ли да декларирам контролера като член на този viewController или просто да декларирам извън блока?
cmtListController
, когато го натиснете, а ARC трябва да добави[cmtListController release]
в края на блока, след последния достъп наcmtListController
. - person Christopher Pickslay   schedule 12.07.2012