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

View Single Post
Old 01-21-2010, 07:26 PM   #1 (permalink)
ykrsdn
Registered Member
 
Join Date: Jul 2009
Posts: 30
ykrsdn is on a distinguished road
Unhappy Storing ImagePickerController Dictionary for use in other action

I want to open an image from the cameraroll and resize it so the user can get a preview of all the changes he's applying to the image without the image taking up too much memory. After the user finishes doing whatever he has to do with the image I allow the user to save the image. When the image is saved, the full sized image is retrieved from the UIImagePickerOriginalImage key and the changes are applied to the full image as well. But there is one big issue.

I can't seem to be able to store the ImagePickerController's Dictionary for use in the save IBAction.

Here's some code to explain my issue :

This is the part where the image is loaded to imaget (the preview's UIImage)
and where the NSDictionary is being stored in a variable I declared before (NSDictionary *dict; )

Code:
- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)editInfo
	{
	[[picker parentViewController] dismissModalViewControllerAnimated:YES];
	dict = editInfo;
	UIImage *imaget = [dict objectForKey:@"UIImagePickerControllerOriginalImage"];
//image get resized
//image gets loaded into the preview
}
Here everything goes smoothly, the image loads into the preview.
Everything that happens between this action and where the user saves is irrelevant as it all works and used to work before.

But here's where the big problem arrises :
In my Save Action I want to call the Original image again from the "dict" NSDictionary, but this fails miserably eventually crashing the app.

Code:
UIImage *imaget = [dict objectForKey:@"UIImagePickerControllerOriginalImage"];
//perform all changes
//save the image
The issue is in the above code and not in any other as I simplified the app until basically only the above code remained and the problem still persisted.

Can anyone help me? Can this NSDictionary be stored into a variable for later use?
ykrsdn is offline   Reply With Quote
 

» Advertisements
» Online Users: 453
16 members and 437 guests
David-T, Davor, djohnson, Duncan C, EdwardH, ElensYang47, fanarin, Hassasin, jbro, kieshatx65, malkagb91, mdpauley, mer10, Paul10, pinky, Rudy
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,436
Threads: 94,026
Posts: 402,590
Top Poster: BrianSlick (7,978)
Welcome to our newest member, ElensYang47
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 08:06 PM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.