Scope of parameter names in Objective C methods
Posted
by G.P. Burdell
on Stack Overflow
See other posts from Stack Overflow
or by G.P. Burdell
Published on 2010-06-16T06:04:14Z
Indexed on
2010/06/16
6:12 UTC
Read the original article
Hit count: 327
// myClass.h
@interface myClass : NSObject {
int variable1;
}
- (int) addOne: (int)variable1;
//myClass.m
- (int) addOne: (int)variable1{
variable1++;
}
My question is: will [myClass addOne:aNumber]
add 1 to aNumber
or will it add 1 to the value of the ivar variable1
?
© Stack Overflow or respective owner