discuss-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSUnarchiver extensions


From: Pierre-Yves Rivaille
Subject: NSUnarchiver extensions
Date: Tue, 26 Feb 2002 11:58:42 +0100

Hello Richard,

As I was trying to add Autoresizing for CustomView in Gorm, I encountered a problem in maintaining multiple initWithCoder version for GSCustomView and GormCustomView.

Usually to get the encoded class version you use versionForClassName:, but in GormCustomView if I call [aCoder versionForClassName: [self class]], i get an error whenever the class i'm decoding is a GSCustomView (which is decoded as a GormCustomView because there was a call to decodeClassName:asClassName:). I haven't found any clean way to know which real class i'm decoding (a GSCustomView when opening a nib or a GormCustomView when drag'n'dropping from the palette).

Therefore I have added two new GNUstep specific methods in NSUnarchiver : +concreteClassNamesForClassName: and -concreteClassNamesForClassName:, which returns an array of classNames that are decoded as a specific class.

Before integrating this in gnustep-base, i want to know what is your opinion on those new methods : will they really bloat the NSUnarchiver code and should i do a dirty trick in Gorm ? or is it ok to add the two methods, one ivar and one classvar ?

Here comes the new NSUnarchiver.m and NSArchiver.h files :
<NSArchiver.h.bz2><NSUnarchiver.m.bz2>


        Pierre-Yves

Attachment: NSArchiver.h.bz2
Description: Binary data

Attachment: NSUnarchiver.m.bz2
Description: Binary data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]