PDA

View Full Version : simple question --> button click load image




mekopolis
Sep 11, 2008, 04:19 PM
this is probably a simple question
im new to the iphone sdk, and have spent most of my initial time learning sqlite3 and integrating a database

i probably should of spent that time learning the simple interface design -haha

my question is

if i want to have the user click on a button, and it will load an image, the image will take up the full iphone screen, and the user can either tap on the screen or hit a back button
should i have a new .xib for just that image and have the button load that .xib
or how do i load it from code from the Main.Xib and when the user taps out of the image, it unloads it and returns to the main.xib where the buttons are

thanks

would i use this code, on button click?
UIImage *image = [UIImage imageNamed:@"myimage.png"]



Niiro13
Sep 11, 2008, 04:23 PM
You can either do it through another xib or right in the main xib...the difference is more of memory management.

The code you wrote is to make a UIImage, not necessarily the displaying of one...

mekopolis
Sep 11, 2008, 07:13 PM
so using it on the same view / .xib window

would i call upon the image to be loaded into the self.view

or do i need to use a UIImagePickerController

i've been scanning through countless forums and i think i am just confusing myself even more -lol-

thanks for your help

Niiro13
Sep 11, 2008, 08:45 PM
Well, I can definitely solve your problem...I'm just not sure what's under the NDA...(surprising that no one posted in my other thread asking about it)

Ron C
Sep 12, 2008, 12:59 PM
I think it was referenced here, but it's at iPhoneDevCentral.org (http://www.iphonedevcentral.org) , called UIImagePickerController Tutorial (http://www.iphonedevcentral.org/tutorials.php?page=ViewTutorial&id=47&uid=25219522)

Ron C