我看到Xcode在Business.m上正确地添加了这些方法
- (void)addDistrictsObjectDistrict *)value {
NSSet *changedObjects = [[NSSet alloc] initWithObjects:&value count:1];
[self willChangeValueForKey:@"Districts" withSetMutation:NSKeyValueUnionSetMutation usingObjects:changedObjects];
[[self primitiveValueForKey:@"Districts"] addObject:value];
[self didChangeValueForKey:@"Districts" withSetMutation:NSKeyValueUnionSetMutation usingObjects:changedObjects];
[changedObjects release];
}不幸的是,xcode没有添加
(void)addDistrictsObjectDistrict *)值;
在Business.h上
换句话说,该方法并不确切地通告给其他人。
为什么?
当我尝试使用函数addDistrictsObject时,收到编译器警告
另外,我也不想更改Business.h或Business.m。xdatamodel仍然会有很大的变化。
那么我该怎么做呢?
有什么方法可以避免编译器警告吗?我应该如何在没有编译器警告的情况下使用addObject,只使用生成的代码?任何类别的解决方案?
发布于 2011-05-11 21:35:18
如果您的数据模型将发生很大变化,那么您可能希望使用mogenerator来生成类文件,而不是使用Xcode工具。
https://stackoverflow.com/questions/5965057
复制相似问题