NSKeyValueCoding ?
NSKeyValueCoding ?
- Subject: NSKeyValueCoding ?
- From: Nico <email@hidden>
- Date: Mon, 15 Jul 2002 09:15:08 +0200
Hi :)
I've got a problem using NSKeyValueCoding.
Let me explain :
I've got a class MyClass. In some other class, I need to create MyClass
objects.
Therefore, in SomeOtherClass.h, I wrote :
/*
@class MyClass;
@interface SomeOtherClass : NSObject
{
NSMutableArray *objects;
MyClass *object1, *object2, *object3;
}
*/
Then in SomeOtherClass.m I try to store my objects into the
NSMutableArray that way :
/*
int i;
object1 = [[MyClass alloc] init];
object2 = [[MyClass alloc] init];
object3 = [[MyClass alloc] init];
NSMutableArray *objects = [[NSMutableArray alloc] init];
for (i=1; i<=3; i++)
{
[objects addObject:[self valueForKey:[NSString
stringWithFormat:@"object%d", i]]];
}
*/
Here is my problem : I'd like to be able to do the following code
object1 = [[MyClass alloc] init];
...
directly from -valueForKey: or something, cause I'll have thousands of
objects, not three...
Unfortunately, I can't [self valueForKey:[NSString
stringWithFormat:@"object%d", i]] = [[MyClass alloc] init] ;-)
My project uses this objects very often... so I can't go further until
I've got a way to do this.
Any ideas ? Thanks !
Nico
_______________________________________________
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.