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
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.
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
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?
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 ?
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.