on 10.5.6 the following code snippet:

        NSPrintInfo* sp = [NSPrintInfo sharedPrintInfo];
        NSDictionary* dict = [sp dictionary];
        NSPrintInfo* pi = [[NSPrintInfo alloc] initWithDictionary: dict];
        NSData* piData = [NSKeyedArchiver archivedDataWithRootObject: pi];

will crash with the following:

*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[NSKeyedArchiver encodeValueOfObjCType:at:]: this archiver cannot encode structs'


with the call stack:

#0      0x96772fb4 in ___TERMINATING_DUE_TO_UNCAUGHT_EXCEPTION___
#1      0x96051e3b in objc_exception_throw
#2      0x96772eeb in +[NSException raise:format:arguments:]
#3      0x96772f2a in +[NSException raise:format:]
#4      0x9689935e in -[NSKeyedArchiver encodeValueOfObjCType:at:]
#5      0x96969a71 in -[NSValue encodeWithCoder:]
#6      0x967e6d2d in _encodeObject
#7      0x9685742d in -[NSKeyedArchiver _encodeArrayOfObjects:forKey:]
#8      0x96806146 in -[NSDictionary(NSDictionary) encodeWithCoder:]
#9      0x967e6d2d in _encodeObject
#10     0x946caa14 in -[NSPrintInfo encodeWithCoder:]
#11     0x967e6d2d in _encodeObject
#12     0x967e64a8 in +[NSKeyedArchiver archivedDataWithRootObject:]
#13     0x00001f3e in main at main.m:19

however, the following doesn't crash:

        NSPrintInfo* sp = [NSPrintInfo sharedPrintInfo];
        NSDictionary* dict = [sp dictionary];
        NSPrintInfo* pi = [[NSPrintInfo alloc] initWithDictionary: dict];
        [pi description];
        NSData* piData = [NSKeyedArchiver archivedDataWithRootObject: pi];

filed as radar #:  6656704
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to