0
即时通讯学习Obj-C和即时通讯治疗,使我的第一个“Hello world”文本的UITableView。启动iphone。 UITableView你好世界与编辑按钮失败
我的问题是我无法在屏幕右侧编辑按钮显示。这是我的代码:
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CellIdentifier = @"Cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
}
[[cell textLabel] setTextAlignment:(UITextAlignmentCenter)];
[email protected]"Hello World";
//[cell.textLabel setText:@"Hola2"];
return cell;
}
和:
- (void)viewDidUnload
{
[super viewDidUnload];
self.navigationItem.rightBarButtonItem=self.editButtonItem;
}
我缺少的东西?
感谢您的帮助。
这段代码没有问题,它工作正常。 – Ron
如果你正在学习iPhone的开发,我强烈建议你[检查出来](http://stackoverflow.com/questions/7296695/beginning-iphone-development-in-xcode-4/7296894#7296894)。 – rjgonzo