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 12-27-2009, 04:59 PM   #1 (permalink)
Registered Member
 
Join Date: Mar 2009
Posts: 140
Default Pass UIImage to another view

Essentially I am getting an image from the iPhone photo library using UIImagePicker. The problem is I want to use the UIImage in another view (Game.m), I want to set the UIImageView BackgroundImage from the other view to it but I have no idea how to do it.

Here is the code I have at the moment:
Code:
- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingImage:(UIImage *)img editingInfo:(NSDictionary *)editInfo {
	image.image = img;	
	[[picker parentViewController] dismissModalViewControllerAnimated:YES];
}
Any help would be greatly appreciated, cheers.

Ozzie
ozzie is offline   Reply With Quote
Old 12-28-2009, 01:06 AM   #2 (permalink)
girls? any new species ?
 
sindhutiwari's Avatar
 
Join Date: Nov 2008
Location: INDIA
Posts: 547
Send a message via MSN to sindhutiwari Send a message via Yahoo to sindhutiwari Send a message via Skype™ to sindhutiwari
Default

store or assign that image in the app delegate and use it where ever you want
__________________
In order to succeed, your desire for success has to be greater than your fear for failure
sindhutiwari is offline   Reply With Quote
Old 12-28-2009, 06:37 PM   #3 (permalink)
Registered Member
 
Join Date: Feb 2009
Location: Belgium
Posts: 106
Default

Storing the image in the appdelegate would definately work, but it's not really the way to go.

Could you explain your situation a little more in detail? Do you have a reference to the Game object in your viewcontroller? Atleast in some viewcontroller you should. Then you can set your image like so:
Code:
myGameObject.imageView.image = image;
That is, if you have that instance variable synthesized correctly. And you could set your Game object as an instance variable in the viewcontroller.
SkyTrix is offline   Reply With Quote
Old 12-28-2009, 08:07 PM   #4 (permalink)
Registered Member
 
Join Date: Dec 2009
Posts: 471
Default

maybe you can use NSUserDefaults
__________________
01010111 01101111 01110111 00101100 00100000 01001010 01110101 01110011 01110100 01101001 01101100 01101100 00110100 00110101 00101100 00100000 01111001 01101111 01110101 01110010 00100000 01110011 01101111 01101111 01101111 00100000 01100011 01101111 01101111 01101111 01101100
WillSDev is offline   Reply With Quote
Reply

Bookmarks

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: 257
19 members and 238 guests
2WeeksToGo, @sandris, AdamL, ADY, BrianSlick, Dani77, diyora, F_Bryant, GHuebner, HDshot, headkaze, mer10, prchn4christ, Rudy, smithdale87, Thompson22, timle8n1, Touchmint, vigu360
Most users ever online was 1,187, 10-11-2011 at 08:09 AM.
» Stats
Members: 158,880
Threads: 89,228
Posts: 380,748
Top Poster: BrianSlick (7,129)
Welcome to our newest member, @sandris
Powered by vBadvanced CMPS v3.1.0

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