[!] UIImagePickerController [Help]

Discussion in 'iOS Development' started by JoshuaCaputo, Nov 29, 2008.

  1. JoshuaCaputo

    JoshuaCaputo New Member

    Joined:
    Aug 2, 2008
    Messages:
    605
    Likes Received:
    0
    Device:
    iPod touch
    I have an "UIImagePickerController" set up to choose an image which it does beautifully but what I am having trouble is making the image I choose replace an "UIImageView" with the selected image.

    Code:
    - (void)useImage:(UIImage *)[COLOR="Red"][B]image[/B][/COLOR] {
    	 
    	//[B][COLOR="Lime"]choosenImage[/COLOR][/B].image = [B][COLOR="Red"]image[/COLOR][/B];
    	[COLOR="Lime"][B]choosenImage[/B][/COLOR] = [ [ UIImageView alloc] initWithImage:[COLOR="Red"][B]image[/B][/COLOR]];
    
    
    }
    
    choosenImage is the image I am trying to change, its an "UIImageView"
    image is the image i am trying to changechoosenImage to, not quite sure what image is.
  2. godogshomie

    godogshomie New Member

    Joined:
    Nov 19, 2007
    Messages:
    558
    Likes Received:
    3
    its not too complex

    Please Register or Log in to view images



    Code:
    - (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingImage:(UIImage *)img editingInfo:(NSDictionary *)editInfo {
    	choosenImage.image = img;	
    	[[picker parentViewController] dismissModalViewControllerAnimated:YES];
    }
    
  3. JoshuaCaputo

    JoshuaCaputo New Member

    Joined:
    Aug 2, 2008
    Messages:
    605
    Likes Received:
    0
    Device:
    iPod touch
    It didn't work...
    ------------------double post merged------------------
    I made the UIImagePickerController in IB, Its all linked up to picker though... does that change anything?

    ChoosenImage is also an IB UIImageView...

    Is there an example somewhere?
    ------------------double post merged------------------
    I tried just logging it but it still didn't work
    ------------------double post merged------------------
    Problem Resolved

    I Needed This:{

    Code:
    @interface *********ViewController : UIViewController <UINavigationControllerDelegate, UIImagePickerControllerDelegate>
    }

Share This Page