我想要使用这种方法来显示第一个模态已被解散后的第二个模式...该方法本身工作正常,除了它需要我传递一个对象作为参数,我真正想要做的是改为传递一个UIImageControllerSourceType。是否有另一种方法,我应该用来做到这一点或有一个简单的方法来使UIImageControllerSourceType对象?我觉得这应该不会太难,但我一直在用它挣扎了一段时间,现在...performSelector:withObject:afterDelay: - 这样做的方式来传递一个对象以外的东西?
- (void)showModalTwoImageSearchViewControllerWithSourceType:(UIImagePickerControllerSourceType *)sourceType {
if (self.modalViewController) {
[self performSelector:@selector(showModalTwoImageSearchViewControllerWithSourceType:)
withObject:sourceType
afterDelay:0.1f];
return;
}
// present second modal view - remembering to deal with cases of camera or photo library
if (sourceType == UIImagePickerControllerSourceTypePhotoLibrary) {
//do one thing
}
// lets assume it was UIImagePickerControllerSourceTypeCamera
else {
// do something else
}
}
谢谢!我知道这是一个简单的答案 - 只是找不到将UIImagePickerController转换为对象的方式。 – 2012-04-16 13:19:39