Re: Unarchive Data from URL (was Can't Convert Image...)
Re: Unarchive Data from URL (was Can't Convert Image...)
- Subject: Re: Unarchive Data from URL (was Can't Convert Image...)
- From: Timothy Larkin <email@hidden>
- Date: Wed, 31 Aug 2005 06:40:55 -0400
I think the problem is that you have created a data object, but not
an archive, which constitutes another layer around the data object.
You need to invoke NSArchiver on the object before you can unarchive
it. Something like this
[self setValue:[NSArchiver archivedDataWithRootObject:data]
forKey:@"image"];
On Aug 30, 2005, at 2:27 PM, Ian G. Gillespie wrote:
When I create an NSData object from a URL and set the data for a
Core Data entity's attributes I got this error:
+[NSUnarchiver unarchiveObjectWithData:]: extra data discarded
This is my code:
-(void)setImagePath:(NSURL *)path {
NSLog([path className]); //just to check that I am actually
getting a URL (could come from an AppleScript)
NSData *data = [NSData dataWithContentsOfURL:path];
[self setValue:data forKey:@"image"];
}
Dp Does anyone know why this is happening when it is unarchived?
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden