저는 scrollview가 있으며 scrollview에 이미지 레이블과 버튼이있는보기를 추가하고 있습니다. 버튼에 액션을 추가하면 모든 것을 실행하면 잘 보이지만 버튼을 클릭하면 앱이 EXC_BAD_ACCESS와 충돌합니다. ARC를 사용하고있어 문제를 일으키는 지 확실하지 않지만 그렇게해서는 안됩니다. 그것은 마치 뭔가가 기억에서 풀린 것처럼 내 행동을 찾지 못하는 것 같습니다. 나는 그 범인 인에 부착하고 그 이유는 내가 정말 여기에 뭔가를 놓친 거지UIButton 조치 EXC_BAD_ACCESS ARC
-(void)lvlSelected:(id)sender{
NSLog(@"Selected level pack");
}
/*
DISPLPAYPACKS
This will take the loaded level packs and display them in the scroll view for selection
*/
-(void)displayPacks{
//Iterate thru the installed level packs and load some tiles they can select
for (int i = 0; i < installedLevelPacks.count; i++){
levelPack *curPack = [installedLevelPacks objectAtIndex:i];
CGFloat x = i * 110;
//Add the view to contain the rest of our elements
UIView *tileView = [[UIView alloc] initWithFrame:CGRectMake(x, 0, 100, 125)];
//view.backgroundColor = [UIColor greenColor];
//Add a label to the bottom to hold the title
UILabel *titleLbl = [[UILabel alloc] initWithFrame:CGRectMake(0, tileView.frame.origin.y+100, 100, 25)];
titleLbl.textAlignment=UITextAlignmentCenter;
titleLbl.font=[UIFont fontWithName:@"American Typewriter" size:12];
titleLbl.adjustsFontSizeToFitWidth=YES;
titleLbl.text=curPack.title;
//Add the preview image to the tile
UIImageView *previewImg = [[UIImageView alloc] initWithImage:[UIImage imageNamed:curPack.previewImg]];
previewImg.frame=CGRectMake(0, 0, 100, 100);
//Add the button over the tile
UIButton *aButton = [UIButton buttonWithType:UIButtonTypeCustom];
aButton.frame = CGRectMake(0, 0, 100, 125);
//Set the tag to the level ID so we can get the pack later
[aButton setTag:i];
[aButton setTitle:curPack.title forState:UIControlStateNormal];
[aButton addTarget:self action:@selector(lvlSelected:) forControlEvents:UIControlEventTouchUpInside];
[tileView addSubview:previewImg];
[tileView addSubview:titleLbl];
[tileView addSubview:aButton];
[lvlScroller addSubview:tileView];
}
//Set the total size for the scrollable content
lvlScroller.contentSize = CGSizeMake(installedLevelPacks.count*110, 125);
}
, 내가 ARC와 함께 전에 이런 짓을하지만하지 않은 : 여기 내 코드입니다.
NSZombie 출력 상태 : Objective-C 메시지가 주소 : 0x6b8d530의 할당 해제 된 개체 (좀비)로 전송되었습니다. 
나에게 클래스의 이름과이 클래스의 객체가 생성되는 위치를 알려주십시오. –
이 메소드는 UIViewController 내부에 있으며 클래스 이름은 LevelPackViewController입니다. 이것은 사용자가 버튼 (시작 버튼)을 누를 때 다른 뷰에서 생성됩니다. – Chevol
UIScrollView 대신보기에 구성 요소를 추가하면 레벨 팩을 스크롤 할 수 없다는 것 외에는 잘 작동합니다. UIScrolView가 릴리스되고 버튼과 대상, idk에 대한 참조가 있다고 생각하게하므로 오류를 반환하지 않습니다. – Chevol