2013-01-18 62 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