2012-05-08 42 views
0

我語法錯誤時,我試圖使用使用BUTTOM釋放UIImagePickerControl在Objective C&IOS 5.1

- (void) imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info 
{ 
// Access the uncropped image from info dictionary 
UIImage *image = [info objectForKey:@"UIImagePickerControllerOriginalImage"]; 

    [viewsavedimage setImage: image]; 

[picker release]; 
} 

之後釋放UIImagePickerControl是[拾取器釋放];對不對?

回答

2

您不應該從imagePickerController中釋放選擇器,因爲它是一個參數。你應該從你調用imagePickerController的地方釋放它。 如果你使用ARC(弱,強),你不需要這樣做。內存管理器爲你做。