First, your code is not trying to serialize the NSURL object; it is trying to create a data object from the data at the URL returned as the URI of the managed object.
Secondly, it will never work.
[NSData dataWithContentsOfURL:] URL-. URI , , SQLite.
URI . URI - , .
NSManagedObject NSCoder, . , , .