2013-01-18 126 views
0

我有一个UITableViewController的子类,当我在viewDidLoad中调用self.tableView时,它崩溃并一直调用相同的方法。我已经将它从使用故事板(它工作正常)转换为代码,现在它出现了这个错误。虽然我有一个UITableViewCell子类的xib文件。tableView属性导致循环

- (void)viewDidLoad 
{ 
[super viewDidLoad]; 

UINib *nib = [UINib nibWithNibName:@"AddCell" bundle:nil]; 

//here 
    [self.tableView registerNib:nib forCellReuseIdentifier:@"AddCell"]; 

self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemCancel target:self action:@selector(cancel:)]; 
self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemDone target:self action:@selector(done:)]; 

// Uncomment the following line to preserve selection between presentations. 
// self.clearsSelectionOnViewWillAppear = NO; 

// Uncomment the following line to display an Edit button in the navigation bar for this view controller. 
// self.navigationItem.rightBarButtonItem = self.editButtonItem; 
} 

想知道是否有人有同样的问题,或者如果有解决方案。

在此先感谢

回答

0

这似乎像它包含上述-viewDidLoad实施已经拥有笔尖类。这意味着每次醒来时,它都会唤醒自己...

......然后醒来本身,然后醒来本身,然后醒来本身,然后醒来本身,然后醒来本身,然后醒来本身,然后醒来然后自我醒来,然后自我醒来,然后自我醒来,然后自我醒来,然后自我醒来,然后自我醒来,然后自我醒悟,然后自我醒悟,然后自我醒悟,然后唤醒自己,然后醒来本身,然后醒来自己,...... ...... ...... ...

这可能是你的问题吗?

+0

我不知道,如果是这样,我怎么解决?谢谢! – user1628311

+1

不要在自动方法中打开一个笔尖,然后调用该自动方法,然后再打开另一个笔尖......直到出现堆栈溢出。 –

+0

好吧,你知道为什么这个故事板没有发生吗? – user1628311