第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問題,去搜搜看,總會(huì)有你想問的

dequeueReusableCellWithIdentifier:forIndexPath:

dequeueReusableCellWithIdentifier:forIndexPath:

慕哥6287543 2019-07-04 13:04:44
dequeueReusableCellWithIdentifier:forIndexPath:中的斷言失敗所以我為我的學(xué)校制作了一個(gè)RSS閱讀器并完成了代碼。我做了測(cè)試它給了我那個(gè)錯(cuò)誤。下面是它所指的代碼:- (UITableViewCell *)tableView:(UITableView *)tableView           cellForRowAtIndexPath:(NSIndexPath *)indexPath {     static NSString *CellIdentifier = @"Cell";     UITableViewCell *cell =       [tableView dequeueReusableCellWithIdentifier:CellIdentifier                                       forIndexPath:indexPath];     if (cell == nil) {         cell =           [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle                                   reuseIdentifier:CellIdentifier];     }以下是輸出中的錯(cuò)誤:2012年-10-04 20:13:05.356閱讀器[4390:C07]*斷言失敗出現(xiàn)在-[UITableView dequeueReusableCellWithIdentifier:forIndexPath:],/SourceCache/UIKit_Sim/UIKit-2372/UITableView.m:4460 2012-10-04 20:13:05.357 Reader[4390:C07]*由于“NSInternalInconsistencyException”異常終止應(yīng)用程序,原因是:“無法用標(biāo)識(shí)符單元格排出單元格-必須為標(biāo)識(shí)符注冊(cè)一個(gè)nib或類,或者在情節(jié)提要中連接一個(gè)原型單元格”*First throw call stack:(0x1c91012 0x10cee7e 0x1c90e78 0xb64f35 0xc7d14 0x39ff 0xd0f4b 0xd101f 0xb980b 0xca19b 0x6692d 0x10e26b0 0x228dfc0 0x228233c 0x228deaf 0x1058cd 0x4e1a6 0x4ccbf 0x4cbd9 0x4be34 0x4bc6e 0x4ca29 0x4f922 0xf9fec 0x46bc4 0x47311 0x2cf3 0x137b7 0x13da7 0x14fab 0x26315 0x2724b 0x18cf8 0x1becdf9 0x1becad0 0x1c06bf5 0x1c06962 0x1c37bb6 0x1c36f44 0x1c36e1b 0x147da 0x1665c 0x2a02 0x2935)libc++abi.dylib:terminate called throwing an exception下面是它在錯(cuò)誤屏幕中顯示的代碼:int main(int argc, char *argv[]){     @autoreleasepool {         return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));     }}救命啊!
查看完整描述

3 回答

?
蝴蝶刀刀

TA貢獻(xiàn)1801條經(jīng)驗(yàn) 獲得超8個(gè)贊

你用的是dequeueReusableCellWithIdentifier:forIndexPath:方法。這個(gè)文獻(xiàn)資料對(duì)于該方法來說,如下所示:

重要:必須使用registerNib:forCellReuseIdentifier:registerClass:forCellReuseIdentifier:方法之前調(diào)用此方法。

您沒有為重用標(biāo)識(shí)符注冊(cè)nib或類"Cell".

查看您的代碼,您似乎期望deQueue方法返回。nil如果它沒有手機(jī)給你。您需要使用dequeueReusableCellWithIdentifier:對(duì)于這種行為:

UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];

注意dequeueReusableCellWithIdentifier:dequeueReusableCellWithIdentifier:forIndexPath:是不同的方法。見醫(yī)生前者后者.

如果你想知道為什么你想用dequeueReusableCellWithIdentifier:forIndexPath:看看這個(gè)問答.


查看完整回答
反對(duì) 回復(fù) 2019-07-04
?
忽然笑

TA貢獻(xiàn)1806條經(jīng)驗(yàn) 獲得超5個(gè)贊

我也有同樣的問題

static NSString *CellIdentifier = @"Cell";
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];

   if (cell==nil) {
        cell = [[UITableViewCell alloc]initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:CellIdentifier];

    }


查看完整回答
反對(duì) 回復(fù) 2019-07-04
  • 3 回答
  • 0 關(guān)注
  • 986 瀏覽

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)