Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

BigHonkingDeal

macrumors 6502a
Original poster
Feb 8, 2009
832
1,027
Fort Pierce
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!
 
Last edited by a moderator:
Maybe someone can give me a pointer....

TIA!

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 :)
 
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.
 
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

...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 :)
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.