-1
我試圖從視圖中刪除圖像選擇器,但沒有成功。無法從視圖中刪除圖像選擇器
會發生什麼事情,在開始時我看到所有的用戶相冊,比我選擇一個和編輯圖像,比被調用的委託,我解僱了控制器,但我比再次看到專輯視圖,我只是無法將其從控制器中刪除。
下面是我添加:
pickerLibrary = [[UIImagePickerController alloc] init];
pickerLibrary.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;
pickerLibrary.delegate = self;
pickerLibrary.allowsEditing=YES;
pickerLibrary.mediaTypes= [[NSArray alloc] initWithObjects: (NSString *) kUTTypeImage, nil];
[self presentViewController:pickerLibrary animated:YES completion:nil];
而就委託我做的:
[self dismissViewControllerAnimated:YES completion:^
{
//till here works fine, but than go back to albums page, here i have tried :
[self dismissViewControllerAnimated:YES completion:nil];
[pickerLibrary.view removeFromSuperView];
//or even setting a timer and than try to close it .
}];
檢查,看看是否在呈現視圖控制器的作品叫dismissViewController。如果你看看它所說的蘋果文檔, 呈現視圖控制器負責解除它所呈現的視圖控制器。如果您在呈現的視圖控制器本身上調用此方法,它會自動將該消息轉發給呈現視圖控制器。 – Sandeep