0

I want to send some object to function for check it and set him some data.

For example: i have 4 properties (with int type) of self class (inherit from NSObject class). And i want to change their data in one function. I must send dress of this properties into function, check it to compare with this dresses of this properties: self.opt1, self.opt2, self.opt3, self.opt4, and set them some values.

I try to create function:

- (void)setupMultiplierForObject:(id)object

but i don't know how i can check object argument to comparison self.opt1 (object to object, not their values).

What if must set into if (<here>) {} construction?

Ivan Trubnikov
  • 177
  • 1
  • 8

1 Answers1

0

I fix-it with next construction:

[self setupMultiplierForObject:&((*self).time1)];

- (void)setupMultiplierForObject:(int*)object { if (object == &((*self).time1)) { // Doing something with self.time1, because we know that ended object - is self.time1 } }

Ivan Trubnikov
  • 177
  • 1
  • 8