Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Feeding NSUnarchiver bad data can cause crash



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 unarchiveObjectWithData: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.


References: 
 >Re: Feeding NSUnarchiver bad data can cause crash (From: "Douglas A. Welton" <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.