iphone - Calling methods with specific values -
for code example below, use [self fall]; instead of code @ *, need value of i sent fall method well. how do this?
- (void)main { (int i=0; <= 100; i++) { [image[i] fall]; * } } - (void)fall { // manipulate image[i]; separately loop } edit: accept oldest answer correct. thanks!
you need -
- (void)fall:(int)i { // manipulate image[i]; separately loop } and call -
- (void)main { (int i=0; <= 100; i++) { [image fall:i]; } }
edit -
if want pass index-
- (void)fall:(int)i { // manipulate image[i]; separately loop } and call -
- (void)main { (int i=0; <= 100; i++) { [self fall:i]; // here can either pass index } }
if want pass image -
- (void)fall:(uiimage)i { // manipulate image[i]; separately loop } and call -
- (void)main { (int i=0; <= 100; i++) { [self fall:imagei]; // here need pass image, if image stored in array, fetch array. or need manipulate in way in storing. } }
Comments
Post a Comment