Making object with variable

Discussion in 'iPad Development' started by Treehugger, Sep 21, 2011.

  1. Treehugger
    Offline

    Treehugger iPF Noob

    Joined:
    Dec 17, 2010
    Messages:
    1
    Thanks Received:
    0
    Trophy Points:
    0
    Location:
    Amsterdam (The Netherlands)
    Ratings:
    +0 / 0
    Hi,

    I have 9 UIImageView objects in my app.
    Now I want to make a loop to change settings on every object.

    Is it possible to have a for-loop and use the variable to make the object?

    for(i=0;i<10;i++) {

    [["object"+i] setBackgroundColor:bg];

    }

    Something like that. Is this possible? And how can I do that?

    Hope someone knows the answer :)

Share This Page