这种情况有5种:
1,加载自定义的tableViewCell的时候总是死在:
XInstrumentOpenCell *cell = [tableViewdequeueReusableCellWithIdentifier:CellTableIdentifier];
解决方法:
因为xib的属性检查器中,没有设置Identifier为cellID
static NSString *CellTableIdentifier = @"cellID";
2,在加载WorkingOrder界面的时候,总是报这个错误:
解决方法:
因为在xib的连接中,有一个变量stateLabel是已经删除了的(用phaseLabel代替了)。虽然代码已经删除了,但是连线还是存在于xib文件中。
删掉这个多余的连接线就好了。
3,检查代码拼写,有时候改了类的名字,但是有些地方没有改过来,就会一直报这种错误,比如
NSArray *secondLevelObjects = [[NSBundlemainBundle] loadNibNamed:@"XOpenPositionContentCell"owner:niloptions:nil];
重点是字串中的类名,一般使用类名定义的时候很好找出来改掉,但是写在字串里面的不容易被发现
4,连线的时候选择的是cell 不是file‘s owner,有时候设置了xib文件的class,但是项目未更新过来,重启xcode。
注意:前四种情况我没有遇到过,看的别人给的,具体行不行我就不知道了。
5,
NSDictionary* dicID = [NSDictionary dictionary];
[dicID setValue:_myCollectionViewID forKey:@"myCollectionViewID"];
[dicID setValue:[NSNumber numberWithInteger:_cyModel.modle_s_Id] forKey:@"dbID"];
[dicID setValue:[NSNumber numberWithInteger:_dataArrayID] forKey:@"dataArrayID"];
[[NSNotificationCenter defaultCenter] postNotificationName:@"DELTEL" object:nil userInfo:dicID];