Arrays?

Discussion in 'iOS Development' started by JoshuaCaputo, Oct 4, 2008.

  1. JoshuaCaputo

    JoshuaCaputo New Member

    Joined:
    Aug 2, 2008
    Messages:
    605
    Likes Received:
    0
    Device:
    iPod touch
    I want to make an array of images lets say 50 images (all the same) and have them randomly appear on the screen. When tapped all do the same thing but only to the one tapped. Possible like

    image[1].onTap = [self function];
  2. gojohnnyboi

    gojohnnyboi Well-Known Member

    Joined:
    Jan 25, 2008
    Messages:
    3,339
    Likes Received:
    55
    this isn't javascript

    Please Register or Log in to view images



    Code:
    [image[1] addTarget:self action:@selector(function) forControlEvents:UIControlEventTouchUpInside];
  3. JoshuaCaputo

    JoshuaCaputo New Member

    Joined:
    Aug 2, 2008
    Messages:
    605
    Likes Received:
    0
    Device:
    iPod touch
    Im glad you understand javascript than

    Please Register or Log in to view images

    .

    How would i make say 500 of these all act the same?
  4. gojohnnyboi

    gojohnnyboi Well-Known Member

    Joined:
    Jan 25, 2008
    Messages:
    3,339
    Likes Received:
    55
    Code:
    UIImage* image[500];
    
    for(NSInteger i=0;i<=500;i++) {
            image[i] = [UIImage imageNamed:@"MyImage.png"];
            [image addTarget:self action:@selector(function) forControlEvents:UIControlEventTouchUpInside];
    }
  5. JoshuaCaputo

    JoshuaCaputo New Member

    Joined:
    Aug 2, 2008
    Messages:
    605
    Likes Received:
    0
    Device:
    iPod touch
    so if i were to do coordinates for each one, itd be?
  6. SkylarEC

    SkylarEC Super Moderator Emeritus Staff Member

    Joined:
    Sep 19, 2007
    Messages:
    6,642
    Likes Received:
    129
    We will not make your app for you. Please use google because arrays are at the core of every C based language.
  7. JoshuaCaputo

    JoshuaCaputo New Member

    Joined:
    Aug 2, 2008
    Messages:
    605
    Likes Received:
    0
    Device:
    iPod touch
    Im not asking for you to make my app. This has been my question for months. Now I figured I would ask again because of the recent NDA update. I have figured out how to do it with xml and through the web but for images offline I can't seem to find the correct way. How about you PM me and if I do happen to use it in any shape or form I will cut you in...

    I wouldn't ask for someone to make the application for me that defeats the purpose of me making the app. I just learn better from example. Are there any source codes that might have a working example in C variations?

    Thanks and Sorry
    ------------------double post merged------------------
    Actually I didn't notice what I did say there I already know how to do that. Nevermind.
  8. gojohnnyboi

    gojohnnyboi Well-Known Member

    Joined:
    Jan 25, 2008
    Messages:
    3,339
    Likes Received:
    55
    Look up some of the class references on apples pages. look at:

    NSArray (NSMutableArray)
    CFArrayRef
  9. JoshuaCaputo

    JoshuaCaputo New Member

    Joined:
    Aug 2, 2008
    Messages:
    605
    Likes Received:
    0
    Device:
    iPod touch

Share This Page