Hello folks.
I have a class with a number of properties. Some of them are used only in specific instances. I need to check whether these properties have been assigned a value; I am thinking about a method similar to isset in php. I alloc and init properties in the genral init methid; I release them in the dealloc method.

- (void) dealloc
{
        [repetitions release];
        [variantEnding release];

        [body release];
        [super dealloc];
}
- (id) init
{
        self = [super init];
        if (self != nil) {
                repetitions = [[NSNumber alloc] init];
                variantEnding = [[NSNumber alloc] init];
                body = [[NSMutableArray alloc] init];
        }
        return self;
}

I assign their value when it is needed.
Let's say I have an instance of this class, called *thisObject. How do I check whether I have assigned a value to thisObject.variantEnding or if the property is inialized but empty? This is probably a noob question, but I couldn't find an answer in the docs.
Thanks in advance.
Davide
_______________________________________________

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