代码之家  ›  专栏  ›  技术社区  ›  iOS.Lover

iPad UIImagePicker问题!

  •  1
  • iOS.Lover  · 技术社区  · 14 年前

    这是我的密码:

    .h.:

    @interface CameraViewController : UIViewController <UIImagePickerControllerDelegate ,UINavigationControllerDelegate> {
    
        UIImagePickerController *ipc;
        UIImageView * image1;
    
    @property (.......................;
    }
    

    m.先生:

        - (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info {
    
    
    
        image1.image = [[info objectForKey:UIImagePickerControllerOriginalImage]retain];
        [[picker parentViewController]dismissModalViewControllerAnimated:YES];
        [picker release];   
    
    }
    
    
    - (void)imagePickerControllerDidCancel:(UIImagePickerController *)picker {
    
        [[picker parentViewController]dismissModalViewControllerAnimated:YES];
        [picker release];
    
    
    }
    
    
    
            -(IBAction) importImage1 {
    
        ipc = [[UIImagePickerController alloc]init];
        ipc.delegate = self;
        ipc.sourceType =  UIImagePickerControllerSourceTypePhotoLibrary;
        [self presentModalViewController:ipc animated:YES];
    }
    
    2 回复  |  直到 14 年前
        1
  •  1
  •   Mc.Lover    14 年前

    在ipadios3.2上,UIImagePickerController必须以 府绸

    看看这个: http://www.cocos2d-iphone.org/forum/topic/6108

        2
  •  2
  •   Rob Napier    14 年前

    [picker release] .

    您应该切换到对所有ivar使用访问器。访问器和dealloc通常是您应该保留或释放ivar的唯一位置。picker不是你的ivar,你也没有创建它,所以你根本不应该发布它。

    Memory Management Programming Guide . 你可以在 Three Magic Words .