Sorry I made a mistake in the second solution. It is:
Code:
- (id) init {
if (self = [super init])
{
[myData addObject:obj1];
[myData addObject:obj2];
[myData addObject:obj3];
}
return self;
}
I wanted to refer directly to myData without using an intermediate array.
The problem is that if i declare myData inside the init function, it will hide the instance variable.
Should I declare the instance variable in some ways? How?
Should I refer to it with self.myData?
Thanks