Iphone 使用特定值调用方法

Iphone 使用特定值调用方法,iphone,objective-c,ios,cocoa-touch,sdk,Iphone,Objective C,Ios,Cocoa Touch,Sdk,对于下面的代码示例,通常我会使用[self fall]而不是*处的代码,但我需要将I的值也发送到fall方法。我该怎么做 - (void)main { for (int i=0; i <= 100; i++) { [image[i] fall]; * } } - (void)fall { // manipulate image[i]; separately from the for loop } -(void)主{ 对于(int i=0;i也许你

对于下面的代码示例,通常我会使用
[self fall]
而不是*处的代码,但我需要将
I
的值也发送到
fall
方法。我该怎么做

- (void)main {
    for (int i=0; i <= 100; i++) {
        [image[i] fall]; *
    }
}

- (void)fall {
    // manipulate image[i]; separately from the for loop
}
-(void)主{
对于(int i=0;i也许你的意思是:

- (void)main {
    for (int i=0; i <= 100; i++) {
        [image[i] fall:i];
    }
}

- (void)fall:(int)i {
    // manipulate image[i]; separately from the for loop
}
- (void)main {
    for (int i=0; i <= 100; i++) {
        [self fall:image[i]];
    }
}

- (void)fall:(NSImage *)image {
    // manipulate image[i]; separately from the for loop
}
-(void)主{
对于(int i=0;i您需要执行-

 - (void)fall:(int)i {
     // manipulate image[i]; separately from the for loop
}
 - (void)fall:(int)i {
     // manipulate image[i]; separately from the for loop
}
打个电话-

- (void)main {
for (int i=0; i <= 100; i++) {
    [image fall:i];
}
- (void)main {
for (int i=0; i <= 100; i++) {
    [self fall:i]; // Now from here you can either pass index
}
- (void)main {
for (int i=0; i <= 100; i++) {
    [self fall:imageI]; // Now from here you need to pass image, if that image is stored in array, then fetch from array. Or you need to manipulate in the way in which you are storing.
}
打个电话-

- (void)main {
for (int i=0; i <= 100; i++) {
    [image fall:i];
}
- (void)main {
for (int i=0; i <= 100; i++) {
    [self fall:i]; // Now from here you can either pass index
}
- (void)main {
for (int i=0; i <= 100; i++) {
    [self fall:imageI]; // Now from here you need to pass image, if that image is stored in array, then fetch from array. Or you need to manipulate in the way in which you are storing.
}
打个电话-

- (void)main {
for (int i=0; i <= 100; i++) {
    [image fall:i];
}
- (void)main {
for (int i=0; i <= 100; i++) {
    [self fall:i]; // Now from here you can either pass index
}
- (void)main {
for (int i=0; i <= 100; i++) {
    [self fall:imageI]; // Now from here you need to pass image, if that image is stored in array, then fetch from array. Or you need to manipulate in the way in which you are storing.
}
-(void)主{

对于(int i=0;当我这样做时,我会收到警告“'UIImageView'可能不会响应'fall:”当循环运行时,应用程序会冻结。有什么想法吗?是的,它会。因为方法是视图控制器的,如果你用图像对象调用它,它肯定会失败。早些时候,我认为图像是某个控制器的名称。检查编辑的帖子。嘿,当我这样做时,我会得到警告“'UIImageView'可能不会响应'fall:”循环运行时应用程序会冻结。有什么想法吗?