NSCachedURLResponse on iOS does not correctly implement the NSCoding protocol

Originator:philip.willoughby
Number:rdar://10375896 Date Originated:2011-11-01
Status:Open Resolved:
Product:iPad SDK Product Version:5.0
Classification:Crash/Hang/Data Loss Reproducible:Y
 
01-Nov-2011 01:19 PM Philip Willoughby:
Summary: After encoding and decoding an NSCachedURLResponse the response data is missing from the decoded version.

Steps to Reproduce:

NSData *saveData = [NSKeyedArchiver archivedDataWithRootObject:cacheResponse];
NSCachedURLResponse *outResponse = [NSKeyedUnarchiver unarchiveObjectWithData:saveData];
NSAssert([outResponse.data isEqual:cacheResponse.data],@"Data inequality after encode/decode");

Expected Results:

Success

Actual Results:

Assertion failure

Regression:

Unknown

Notes:

If this is by design there needs to be a huge flashing red warning box saying so at the top of the NSCachedURLResponse documentation

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!