tags:

views:

64

answers:

3

i want to assign a content of one variable to another

A: 

The purpose of a setter is not to assign one variable to another.

What you want is a method.

Wade Williams
A: 

I am guessing the poster wanted something like this:

@interface MyClass : NSObject
{
    int someRandomiVar;
}

@property int veryImportantNumber;

@end

@implementation MyClass

@synthesize veryImportantNumber = someRandomiVar;

@end
Steam Trout
That may be what he wanted, but it's horrible design and not the purpose of a setter. If he really wants to assign a variable to another based on a method call, then he should write a method: [myObj assignValueOfSomeRandomiVarToVeryImportantNumber]; (not a suggested naming to be sure) - Yes, in reality it's just semantics, but if you corrupt the purpose of your setters you can't depend on their behavior at all.
Wade Williams
Not that I say that's a good coding practice, mind you. I am just trying to decipher the vague meaning of the OP's question :)
Steam Trout