ViewView를 빌드하고 그려주는 TableView가 있지만보기를 스크롤 할 때 충돌이 발생합니다. 나는 디버거를 통해 실행했고, 클래스 레벨 변수가 어떻게 든 덮어 써 져서 titleForHeaderInSection이 다시 호출 될 때 더 이상 존재하지 않는 것처럼 보입니다. 매우 이상한 것은입니다 나는 코드를 대체하는 경우 :스크롤 할 때 UITableView가 충돌합니다.
-(NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section
{
NSString *sectionTitle = @"Test";
return sectionTitle;
}
그것은 여전히 충돌
하지만 디버거를 나열하지있는 NSString 당신이 sectionTitle 변수 위에 마우스를 올려이 시간 :와
-(NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section
{
NSString *sectionTitle = [favouritesDataSections objectAtIndex:section];
return sectionTitle;
}
.
이 내가보기를 만드는 데 사용되는 코드이며, 클래스 레벨의 변수 설정 :
- (void)loadView {
[super loadView];
CGRect tableSize = CGRectMake(0,0,320,460);
UITableView *favouritesTableView = [[UITableView alloc] initWithFrame:tableSize style:UITableViewStylePlain];
favouritesTableView.autoresizingMask = (UIViewAutoresizingFlexibleWidth|UIViewAutoresizingFlexibleHeight);
favouritesTableView.dataSource = self;
favouritesTableView.delegate = self;
favouritesTableView.rowHeight = 52;
[self.view addSubview:favouritesTableView];
}
- (void)viewDidLoad {
[super viewDidLoad];
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *documentsDirectory = [paths objectAtIndex:0];
// Get the full path of the favourites plist
NSString *filename = [documentsDirectory stringByAppendingPathComponent:@"Favourites.plist"];
// Initialise Dictionary and array
favouritesDataAll = [[NSMutableDictionary alloc] init];
favouritesDataSections = [[NSArray alloc] init];
NSDictionary *dict = [[[NSMutableDictionary alloc] initWithContentsOfFile:filename] retain];
favouritesDataAll = dict;
[dict release];
favouritesDataSections = [favouritesDataAll allKeys];
}
나는이를 추적하려고 절대적으로 미친 하겠어을 - 지금까지 그렇게 될 것이다 그것에 이일을 보냈다 어떤 도움이든지 외부에 감사드립니다. 메모리 손상이 여기에 무슨 어떤 종류의 존재처럼
안부
는데이브
확인 후 콘솔이 제공 : *** - [UISwipeGestureRecognizer 길이] : 인식 할 수없는 선택기 예를 0x43325d0 –
로 전송 또한 : 캐치되지 않은 예외 'NSRangeException'로 인해 앱 종료 중, 이유 : '*** - [NSCFArray objectAtIndex :] : 인덱스 (0) 초과 (0)' –
괜찮습니다. 그 유지는 제가 생각하기에 붉은 청어였습니다. titleForHeaderInSection을 @ "Test"로 대체했기 때문에 그것은 잠시 동안 작동했습니다. 콘솔 오류 : *** 캐치되지 않은 예외 'NSRangeException'으로 인해 응용 프로그램 종료 중, 이유 : '*** - [NSCFArray objectAtIndex :] : 인덱스 (57744) 초과 (2)' –