我是 iphone 开发新手。我在我的应用程序中实现 UIImagePickerController。当调用 didFinishPickingMediaWithInfo 委托时,即单击选择按钮时有一些延迟。我的代码如下
- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info
{
LGViewHUD* hud = [LGViewHUD defaultHUD];
hud.activityIndicatorOn=YES;
hud.bottomText=@"Login..";
[hud showInView:picker.view];
[self performSelectorInBackground:@selector(pickerFunction:) withObject:info];
}
- (void) pickerFunction :(NSDictionary *)info
{
profilePicture.image = [info objectForKey:@"UIImagePickerControllerEditedImage"];
[imgPicker dismissModalViewControllerAnimated:YES];
}
我正在尝试在选择按钮操作上添加一个 hud,但它只是在一些延迟之后才会出现。有人可以建议我一种实现此方法的方法。
提前致谢..