@interface Dico: NSObject
{
NSMutableString *egy;
}
+ (id) new;
- (void) setEgy: one;
@end


- (id) init
{
 if( (self = [super init]) )
 {
   egy = @"";

May I point out that even though the instance variable is declared to hold a mutable string, that this assignent actually sets it to an NSString. The compiler should have warned about this also. To get a mutable string you should try:
egy = [NSMutableString new];


void main(void)
{
 NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
 Dico *szotar = [[Dico alloc] init];

[szotar setEgy: @"nagzo ddf"];

and either [szotar setEgy: [NSMutableString stringWithString: @"nagro ddf"]];
or [szotar addEgy: @"nagro ddf"];
and implement
- (void)addEgy:(NSString *)addition
{
[egy appendString: addition];
}



On the other hand, I must also admit that your code samples didn't seem to reflect your stated intentions, and that Pascal's reply seems better focused at your expressed intent.


May I suggest the following tutorial on some of the basic GNUstep classes, such as:
NSString / NSMutableString
NSArray / NSMutableArray
NSDictionary / NSMutableDictionary
http://www.gnustep.it/nicola/Tutorials/BasicClasses/


Cheers,
David





_______________________________________________
Help-gnustep mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/help-gnustep

Reply via email to