테이블보기에 5 개의 사용자 정의 셀로 구성된 일부 양식이 있습니다. 여기에 코드입니다 :셀 편집을 시도 할 때 UITableView가 충돌 함
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
return 1;}
\- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
return 5;
}
\- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
NSLog(@"in here");
static NSString *MyIdentifier = @"MyIdentifier";
FreeSignupCell *cell = (FreeSignupCell *)[tableView dequeueReusableCellWithIdentifier:MyIdentifier];
if (cell == nil) {
NSLog(@"shazam");
cell = [[[FreeSignupCell alloc] initWithFrame:CGRectZero reuseIdentifier:MyIdentifier] autorelease];
cell.selectionStyle = UITableViewCellSelectionStyleNone;
}
switch (indexPath.row) {
case 0:
NSLog(@"index 0");
[cell setLabelContent:@"First Name"];
//self.firstName = [cell getText];
break;
case 1:
NSLog(@"index 1");
[cell setLabelContent:@"Last Name"];
//self.lastName = [cell getText];
break;
case 2:
NSLog(@"index 2");
[cell setLabelContent:@"Company (optional)"];
//self.company = [cell getText];
break;
case 3:
NSLog(@"index 3");
[cell setLabelContent:@"Website (optional)"];
[cell setText: @"http://"];
//self.website = [cell getText];
break;
case 4:
NSLog(@"index 4");
[cell setLabelContent:@"E-mail"];
//self.email = [cell getText];
break;
default:
[cell setLabelContent:@"E-mail"];
}
return cell;
}
-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
return 70.0;
}
문제는 그 나는 마지막에 빠르게 스크롤 첫 번째 필드, objc_mssend 오류와 응용 프로그램의 충돌을 편집 할 때.
아이디어가 있으십니까?
FreeSignupCell 클래스의 어딘가에 문제가있는 것 같습니다. 게시 한 코드에서 아무런 문제가 보이지 않습니다. – Vladimir
편집을하지 않고 위아래로 스크롤하면 오류가 발생합니까? FreeSignupCell에 코드를 게시 할 수 있습니까? NSZombie를 켜서 무엇이 해제되는지 확인하십시오. – lyonanderson
아니, 편집하려고 할 때. 시뮬레이터에서는 발생하지만 장치에서는 발생하지 않는다는 것이 흥미 롭습니다. 나는 혼란 스럽다. – Mladen