本文主要是介绍[NSArray count]: method only defined for abstract class. Define -[IngredientsMutableArray count],希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
类似这样的问题~
出错原因:
NSArray 和 NSDictionary 都是簇类,一般不建议写一个类去继承他们。
解决:
如果非要继承,一定要准确的重写这些基本的方法:
insertObject:atIndex:removeObjectAtIndex:addObject:removeLastObjectreplaceObjectAtIndex:withObject:
更好的选择:
1,Use a category
2,Create a new class that has an NSArray as a member variable
这篇关于[NSArray count]: method only defined for abstract class. Define -[IngredientsMutableArray count]的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!