Newbie question, Is it possible to have an object property that increments everytime an object is instantiated?

@interface foo : NSObject {
        NSString        *name;
}
@property (copy,readwrite) NSString *name;
@end

#import "foo.h"
@implementation foo
- (id) init {
        self = [super init];
        if (self != nil) {
                [self setName:@"untitled1"];
        }
        return self;
}
@synthesize name;
@end

I have an NSTableColumn that is bound to foo.name. An NSArrayController looks after adding and removing the foo objects. How can I make the name property increment from untitled1, untitled2, untitled3... etc as the objects are added to the array?

Any help would be appreciated

Regards

Rob Carruthers
_______________________________________________

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 [EMAIL PROTECTED]

Reply via email to