0
나는이델리게이트 함수가 호출 될 때마다 어떻게 텍스트 필드를 만들 수 있습니까? 내가 위임 함수가 호출 때마다 ALLOC해야 내 tableview에 텍스트 필드를 스크롤 할 때
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tv {
return 3;
}
- (NSInteger)tableView:(UITableView *)tv numberOfRowsInSection:(NSInteger)section {
if(section==2)
return 20;
else
return 1;
}
- (UITableViewCell *)tableView:(UITableView *)tv cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *MyIdentifier = @"MyIdentifier";
UITableViewCell *cell = [self.tableView dequeueReusableCellWithIdentifier:MyIdentifier];
//if (cell == nil)
cell = [[[UITableViewCell alloc] initWithFrame:CGRectZero reuseIdentifier:@"MyIdentifier"]autorelease];
// Configure the cell
switch (indexPath.section) {
case 0:
{
textField=[[[UITextField alloc]initWithFrame:CGRectMake(5, 10, 290, 70)]autorelease];
textField.delegate=self;
textField.keyboardType=UIKeyboardTypeURL;
textField.autocorrectionType=YES;
textField.textColor=[UIColor blackColor];
[email protected]"Enter feed url";
[cell.contentView addSubview:textField];
break;
}
case 1:
{
textField1=[[[UITextField alloc]initWithFrame:CGRectMake(5, 10, 290, 70)]autorelease];
textField1.delegate=self;
textField1.keyboardType=UIKeyboardTypeURL;
textField1.textColor=[UIColor blackColor];
textField1.autocorrectionType=YES;
[email protected]"Enter starting url";
[cell.contentView addSubview:textField1];
break;
}
case 2:
{
cell.text=[[PopeularSiteArray objectAtIndex:indexPath.row]objectForKey:@"Title"];
break;
}
default :
break;
}
return cell;
}
과 같은 코드를 사용하고 ... 나는 텍스트 필드 만이 생성됩니다 아무 것도 없을 때처럼 그 코드를 변경하지만를 텍스트 필드에 가비지 값을 표시합니다.
여기서 무엇을 사용할 수 있습니까?