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