[問題] 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