Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

Make your own iPhone apps
and run them live!
(free)

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Development

Reply
 
LinkBack Thread Tools Display Modes
Old 07-29-2011, 03:13 PM   #1 (permalink)
Registered Member
 
Join Date: Jul 2011
Posts: 42
xcoderx is on a distinguished road
Talking Add UIImage view's image to another?

Hey guys i have something like an app that lets u buy things. I have images of the products on one page and when the image of the product is selected, it adds its to the users cart. But my problem is: I cannot get the images to go to the cart view. I press the add to cart button and it doesn't work. Here is my code: Could someone please help? Thanks

Code:
- (IBAction)buttonForImage1:(id)sender {
    MyCartViewController * cart = [[MyCartViewController alloc]init];
    cart.productImage = image2;
}

Last edited by xcoderx; 07-29-2011 at 03:23 PM.
xcoderx is offline   Reply With Quote
Old 07-29-2011, 03:17 PM   #2 (permalink)
Reading the Documentation
 
baja_yu's Avatar
 
Join Date: Sep 2010
Location: 45.255019,19.844908
Posts: 5,414
baja_yu has a spectacular aura about
Default

What is image2 on that view controller and what is it on MyCarViewController? Also, you are creating a new view controller there and doing nothing with it afterwards, not even releasing it, so it leaks as well.
baja_yu is offline   Reply With Quote
Old 07-29-2011, 03:22 PM   #3 (permalink)
Registered Member
 
Join Date: Jul 2011
Posts: 42
xcoderx is on a distinguished road
Default

Quote:
Originally Posted by baja_yu View Post
What is image2 on that view controller and what is it on MyCarViewController? Also, you are creating a new view controller there and doing nothing with it afterwards, not even releasing it, so it leaks as well.
image2 is just another image. Imagine you are browsing thru different sunglasses, and you see a pair you like (lets say the 4th pair from the top) so you click on the "Add To cart" button and i want the picture of those sunglasses to be on the MyCartViewController's view. and i just named the two images the same but they are on different view controllers. Sorry for the inconvenience :/ ill fix that right now so its easier to understand
xcoderx is offline   Reply With Quote
Old 07-29-2011, 03:36 PM   #4 (permalink)
Reading the Documentation
 
baja_yu's Avatar
 
Join Date: Sep 2010
Location: 45.255019,19.844908
Posts: 5,414
baja_yu has a spectacular aura about
Default

In that case it's fine, but you still just create a new view controller and just leak it. Aren't you supposed to present or push if you are using a navigation controller?
baja_yu is offline   Reply With Quote
Old 07-29-2011, 03:41 PM   #5 (permalink)
Registered Member
 
Join Date: Jul 2011
Posts: 42
xcoderx is on a distinguished road
Default

Quote:
Originally Posted by baja_yu View Post
In that case it's fine, but you still just create a new view controller and just leak it. Aren't you supposed to present or push if you are using a navigation controller?
ok good because i fixed the leaks now thanks but I'm not using that I'm just using a normal button to add this to the cart and then i have another button to go to the cart page ?
xcoderx is offline   Reply With Quote
Old 07-29-2011, 03:54 PM   #6 (permalink)
Reading the Documentation
 
baja_yu's Avatar
 
Join Date: Sep 2010
Location: 45.255019,19.844908
Posts: 5,414
baja_yu has a spectacular aura about
Default

In that case don't pass images like that, one by one. Instead make an array, and add each tapped image to the array. Then when the user taps the button to show the cart, create the cart controller, pass the array (of images) to it, and show it.
baja_yu is offline   Reply With Quote
Reply

Bookmarks

Tags
iphone, uiiimage, uiimageview

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Online Users: 393
14 members and 379 guests
7twenty7, blasterbr, buggen, chiataytuday, dre, fiftysixty, HemiMG, jimmyon122, jonathandeknudt, LEARN2MAKE, nyoe, pungs, tymex, UMAD
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,668
Threads: 94,121
Posts: 402,902
Top Poster: BrianSlick (7,990)
Welcome to our newest member, jonathandeknudt
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 04:02 AM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0