所以我不確定這裏發生了什麼,但在iOS 6之前,使用故事板,我會這樣做來創建一個UITableViewCell子類。無法加載iOS 6中的UITableViewCell筆尖
1)爲我的網點創建的UITableViewCell子類.h和.m。 2)在故事板中的ViewController上創建的自定義UITableViewCell。將其身份更改爲自定義UITableViewCell。給它重用標識符名稱。
然後,當我想實例化細胞,在視圖控制器的類,在
static NSString *TotalDistanceCellIdentifier = @"TotalDistanceCellIdentifier";
在viewDidLoad中:然後
[self.tableView registerNib:[UINib nibWithNibName:@"TotalDistanceTableViewCell" bundle:nil] forCellReuseIdentifier:TotalDistanceCellIdentifier];
中的cellForRowAtIndexPath:
TotalDistanceTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:TotalDistanceCellIdentifier];
return cell;
在iOS 5中和5.1,我看到我的UITableViewCell。但是,在我的iPhone運行iOS 6或iOS 6的模擬器,它崩潰了:
Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Could not load NIB in bundle:.....with name 'TotalDistanceTableViewCell''
難道在UItableViewCells一些變化的iOS 6?謝謝!