Re: Feeding NSUnarchiver bad data can cause crash
Re: Feeding NSUnarchiver bad data can cause crash
- Subject: Re: Feeding NSUnarchiver bad data can cause crash
- From: Jeremy Dronfield <email@hidden>
- Date: Thu, 3 Jun 2004 17:05:13 +0100
On 3 Jun 2004, at 4:10 pm, Douglas A. Welton wrote:
Jeremy,
When you say, "it doesn't work" do you mean that an exception not
thrown OR
do you mean that your code did not do what it was supposed to do?
I mean that the exception isn't thrown. The unarchiver still crashes
the app. I get exactly the same behaviour with the handler placed in a
home-made -canBeUnarchived: method as you described:
- (BOOL)canBeUnarchived:(NSData *)Target_Data
{
id archive;
BOOL success = NO;
NS_DURING
archive = [NSUnarchiver unarchiveObjectWith
Data:Target_Data];
success = YES;
NS_HANDLER
success = NO;
NS_ENDHANDLER
return success;
}
It still crashes when the bad data is unarchived.
Regards,
-Jeremy
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.