作者qnismine (qn是我的)
看板MacDev
标题[问题] core data 在 ios10的问题一问..
时间Fri Feb 10 20:23:56 2017
大家好 我的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里面有很多这种 想从根本解决...
先谢谢各位了...
--
※ 发信站: 批踢踢实业坊(ptt.cc), 来自: 114.25.107.179
※ 文章网址: https://webptt.com/cn.aspx?n=bbs/MacDev/M.1486729442.A.A68.html
※ 编辑: qnismine (114.25.107.179), 02/10/2017 20:40:20
※ 编辑: qnismine (114.25.107.179), 02/10/2017 20:40:47