在storyboard中运用coredata时会出现这个错误 : exception 'NSInvalidArgumentException', reason: '+entityForName:
来源:互联网 发布:炒外汇交易软件 编辑:程序博客网 时间:2024/05/02 01:00
exception 'NSInvalidArgumentException', reason: '+entityForName: nil is not a legal NSManagedObjectContext parameter searching for entity name 'SaveDate''
出现这个问题的原因是正常创建的程序都会带有一个window, 而storyboard中却没有window所以会出现这个问题,
由于本人接触iOS的时间不是很长, 给出的方法不一定是最合适的, 知识能解决问题, 给遇到问题的同志们一个参考
解决的方法是在 coredata的语句中添加两句话:
id delegate = [[UIApplicationsharedApplication] delegate];
_context = [delegatemanagedObjectContext];
_content是你自己创建的用来接受 AppDelegate里的managedObjectContent的属性在每个添加,查找,删除都加上这两行代码,问题就解决了
0 0
- 在storyboard中运用coredata时会出现这个错误 : exception 'NSInvalidArgumentException', reason: '+entityForName:
- iOS coreData 程序出错:Terminating app due to uncaught exception 'NSInvalidArgumentException', reason:
- exception ‘NSInvalidArgumentException’, reason: ‘data parameter is nil
- 错误2:Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSCFType pi
- 为什么在编译java时会出现Exception in thread "main" java.lang.NoClassDefFoundError错误?
- Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[YCFlag objectAtIn
- Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSCFString cont
- 解决NSInvalidArgumentException', reason: '-[NSNull]
- 调用XIB文件时出错:Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '....
- iOS8.0以上出错Terminating app due to uncaught exception \'NSInvalidArgumentException\', reason: \'Invalid Region\'
- Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'to-many key not all
- Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Pushing the same vi
- Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '+[.....报错的问题
- Mac Notes备忘录崩溃打不开:Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '
- NSInvalidArgumentException', reason: '*** -[NSURL initWithString:relativeToURL:]:
- VC++ 在两个文件互相包含时会出现的错误
- 出现Terminating app due to uncaught exception 'NSUnknownKeyException', reason: 错误的解决方法
- eclipse中导入工程时会出现很多错误的解决办法
- OpenGL ES2.0编程三步曲
- English Contest -- The Programmer's Dream
- 大型网站系统架构演化之路
- EGL接口介绍
- Linux daemon进程的应用、实现和原理
- 在storyboard中运用coredata时会出现这个错误 : exception 'NSInvalidArgumentException', reason: '+entityForName:
- 《Hadoop基础教程》之初识Hadoop
- Cmd Markdown 全平台客户端下载
- POJ 1185-炮兵阵地
- 《异常处理类中断服务程序挂接》
- 字符串处理
- Surf算法原理及openCV代码实现
- 适合中文版本的Easy RM to MP3 Converter rop 过depexploit
- Caused by: java.lang.NoSuchMethodError: javax.persistence.Table.indexes()[Ljavax/persistence/Index