[问题] core data 在 ios10的问题一问..

楼主: qnismine (qn是我的)   2017-02-10 20:23:56
大家好 我的core data里面有一个 type是 transfermable
主要是把它取出来 再把它 转成 nsurl.
在ios 10以前都没有任何闪退问题....
在ios10之后...由于我在AppDelegate.m的applicationWillResignActive这个method里面
下了 [context save]这个方法
结果却在[managedObjectContext save:&error]这行闪退了
我看error log写着
-[NSURL init] called;
this results in an NSURL instance with an empty URL string.
Please use one of the documented NSURL initialization methods instead
(initWithString:, initFileURLWithPath:, etc.).
This message shown only once.
-[NSURL transformedValue:]: unrecognized selector sent to instance 0x170667a40
Terminating app due to uncaught exception 'NSInvalidArgumentException', reason:
'-[NSURL transformedValue:]: unrecognized selector sent to instance
然后我把那个transferrmable的型态改成string在取出来转成nsurl...就没事了
代表真的是那行出了问题...
要怎么改才能维持旧的呢....因为code里面有很多这种 想从根本解决...
先谢谢各位了...

Links booklink

Contact Us: admin [ a t ] ucptt.com