newbie question....

Discussion in 'iOS Programming' started by BigHonkingDeal, Oct 3, 2011.

  1. BigHonkingDeal, Oct 3, 2011
    Last edited by a moderator: Oct 3, 2011

    BigHonkingDeal macrumors 6502a

    BigHonkingDeal

    Joined:
    Feb 8, 2009
    Location:
    Miami, FLA
    #1
    Hi, I'm trying to teach myself IOS programing and i'm stuck on a probably simple problem.

    I'm passing an image name to a view controller

    Code:
    [nextController changeImg:[imagesList objectAtIndex:indexPath.row]];
    and want to set imageNamed in nextController but can not figure out how :)

    Code:
    UIImage *image = [UIImage imageNamed:[NSString stringWithFormat:@"%@", (NSString *)productImg.image]];
    Maybe someone can give me a pointer....

    TIA!
     
  2. ianray macrumors 6502

    Joined:
    Jun 22, 2010
    Location:
    @
    #2
    Code:
    [NSString stringWithFormat:@"%@", (NSString *)productImg.image]
    One pointer: the above is the same as...

    Code:
    productImg.image
    ...assuming productImg.image is of type NSString. (And if it is not of type NSString then you might be in trouble.)

    Otherwise you have not given us enough information to help you. Good luck :)
     
  3. jnoxx macrumors 65816

    jnoxx

    Joined:
    Dec 29, 2010
    Location:
    Aartselaar // Antwerp // Belgium
    #3
    You need to learn what properties are from objects, what are the relations between your controllers and so on, otherwise you will get stuck within 10 seconds. Sorry to break it to you, we/I can explain you what's wrong/what to do, but you'll break your head like 10 minutes after, which is a bit of a waste.
     
  4. BigHonkingDeal thread starter macrumors 6502a

    BigHonkingDeal

    Joined:
    Feb 8, 2009
    Location:
    Miami, FLA
    #4
    Thanks for your reply!

    Code:
    [nextController changeimg:[imagesList objectAtIndex:indexPath.row]];
    I am pushing the above string to nextController

    and can not figure out how to set an NSString in nextController so I can access the string there.....

    If I create a UIImage in the nib it shows up perfectly but I need use it in an overlay.

    TIA

     

Share This Page