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

Mockup & CodeGen, iPhone & iPad
($9.99)

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

Manu
($0.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 02-26-2010, 02:09 PM   #1 (permalink)
Registered Member
 
Join Date: Feb 2010
Posts: 16
Default Keeping UIImageView Between Views

Hello All,

I'm a new member to the forum but a long time reader. I've just started developing apps for the iPhone after screwing around with the SDK for a while.

Anyway, I've started a new app and need help with an imageview.

I have two views, and on the bottom of each view it has a button to flip to the other. On the first side, it has two buttons (in addition to the flipping button on the bottom) to either select an existing image, or to take a new one.

Once the image is selected, it displays the image in an imageview right above the buttons. Up to this point, everything works correctly.

Here's where I'm getting stuck:

I need to display the selected image on a separate view. I'm not sure how to take the selected image and bring it over to the other view, and after 3 hours of googling, I still can't figure this out.

Thank you in advance, and I hope to contribute here once I get this issue sorted out.

Thanks,

Max
mJusticz is offline   Reply With Quote
Old 02-27-2010, 01:09 PM   #2 (permalink)
Registered Member
 
Join Date: Feb 2010
Posts: 16
Default

Sorry, but I have to give this a bumpety bump bump bump.
mJusticz is offline   Reply With Quote
Old 02-27-2010, 01:23 PM   #3 (permalink)
Registered Member
 
Join Date: Dec 2008
Location: UK
Posts: 1,886
Default

In your second view, have a method for setting the new UIImageView:
Code:
-(void)setTheImage:(UIImage*)anImage {
   [theImageView setImage:anImage];
}
Then, when you call the second view, add the following:
Code:
[theSecondView setTheImage:myFirstImageView.image];
Or something along those lines.
harrytheshark is offline   Reply With Quote
Old 03-03-2010, 07:20 PM   #4 (permalink)
Registered Member
 
Join Date: Feb 2010
Posts: 16
Default Thank you!

Thanks so much, Harry. Much appreciated.
mJusticz is offline   Reply With Quote
Old 03-03-2010, 08:21 PM   #5 (permalink)
Registered Member
 
Join Date: Feb 2010
Posts: 16
Default

I'm having an issue with this part

Code:
[theSecondView setTheImage:myFirstImageView.image];
Mainly, where do I put it? You say to put it where I call the second view. I'm using a utility template with the info button, so I put it in the showInfo action, (I'm not sure if that's a n00b mistake.).

So, where does this line go?

Code:
[FlipsideViewController setTheImage:imageView.image];
mJusticz is offline   Reply With Quote
Old 03-04-2010, 02:45 AM   #6 (permalink)
Registered Member
 
Join Date: Dec 2008
Location: UK
Posts: 1,886
Default

I've never used the utility template, but from the sounds of it, putting the code in the showInfo method should be fine.
harrytheshark is offline   Reply With Quote
Old 03-04-2010, 06:48 PM   #7 (permalink)
Registered Member
 
Join Date: Feb 2010
Posts: 16
Default

I'm not sure why, but when I put it into "showInfo," the whole app freezes when I do press the info button. Any ideas? In fact, no matter where I put it, it freezes. It gives me the warning "FlipsideViewController may not respond to +setTheImage."

Last edited by mJusticz; 03-04-2010 at 07:07 PM. Reason: Forgot to add detail
mJusticz is offline   Reply With Quote
Old 03-05-2010, 02:42 AM   #8 (permalink)
Registered Member
 
Join Date: Dec 2008
Location: UK
Posts: 1,886
Default

You need to put the method "setTheImage" in the FlipsideViewController, mentioning it in the .h file
harrytheshark is offline   Reply With Quote
Old 03-05-2010, 05:34 PM   #9 (permalink)
Registered Member
 
Join Date: Feb 2010
Posts: 16
Default

Ok. I'm still not getting it, and it is still getting stuck when I hit the flip button. Would you mind taking a look at my .proj file? I would really appreciate it.

Thanks for your time,

Max
mJusticz is offline   Reply With Quote
Reply

Bookmarks

Tags
imagepicker, multiple, uiimagepicker, uiimageview, views

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: 248
23 members and 225 guests
ADY, AragornSG, bookesp, chillyh, dacapo, Dani77, Davey555, Dominus, dre, glenn_sayers, HemiMG, JasonR, karlam963, M.A.S., marshusensei, mer10, nobre84, Oral B, prchn4christ, Raggou, Rudy, spiderguy84, themathminister
Most users ever online was 1,187, 10-11-2011 at 08:09 AM.
» Stats
Members: 158,885
Threads: 89,230
Posts: 380,765
Top Poster: BrianSlick (7,129)
Welcome to our newest member, bookesp
Powered by vBadvanced CMPS v3.1.0

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