Array of UIImage?

Discussion in 'iOS Programming' started by ionini, Sep 23, 2011.

  1. ionini macrumors newbie

    Joined:
    Aug 29, 2011
    #1
    Code:
     for (x=0; x<15; x++) {
            num = [NSString stringWithFormat:@"%i", x];
            imagennombre =  [NSString stringWithFormat:@"%@%@", @"BIT_nadandoLoop_000", num];
            UIImage * imagen = [UIImage imageNamed:imagennombre];
            [imagenes addObject:imagen];
    
        }
        for (x=0; x<15; x++) {
            imageview.image=[UIImage imagenes[x]];
            
        }
    I have no idea how to do this...
    please help.
     
  2. jnoxx macrumors 65816

    jnoxx

    Joined:
    Dec 29, 2010
    Location:
    Aartselaar // Antwerp // Belgium
    #2
    I'll keep it easy for ya
    Code:
    NSMutableArray *imageArray = [[NSMutableArray alloc] initWithObjects:@"testImage.png", @"test2image.png", @"test3image.png", nil];
    for (int i = 0; i < [imageArray count]; i++)
    {
       UIImageView *imageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:[imageArray objectAtIndex:i]];
    } 
    
    I'm on my windows machine so can't really test it, but should be something similair like that, your array is just wrong, you are trying to use C cyntax instead of ObjC (should work though.)
     
  3. xStep macrumors 68000

    Joined:
    Jan 28, 2003
    Location:
    Less lost in L.A.
    #3
    Once again, I have no idea what it is you are asking.
     
  4. dejo Moderator

    dejo

    Staff Member

    Joined:
    Sep 2, 2004
    Location:
    The Centennial State
    #4
    Is this really different from your previous thread?
     
  5. xStep macrumors 68000

    Joined:
    Jan 28, 2003
    Location:
    Less lost in L.A.
    #5
    I was thinking the same thing. ionini never did finish off that thread. I really wonder about the person.
     

Share This Page