3

我有一个 imagePickerController 允许用户拍摄或选择图像。在 - (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info; 我想触发打开另一个模态视图来捕获标题。我有一个为此目的的电话...

-(void) getcaption:(id) obj {
    textInput * ti = [[textInput alloc] initWithContent:@"" header:@"Caption for photo" source:2];
    ti.delegate = self;
    [self presentModalViewController:ti animated:YES];
    [ti release];
}

问题是如何在不触发螺旋式的情况下调用 getcaption

#6663 0x324abb18 在 -[UIView(Hierarchy) _makeSubtreePerformSelector:withObject:withObject:copySublayers:] ()

目前我做

[self performSelector:@selector(getcaption:)  withObject:nil afterDelay:(NSTimeInterval)1];

在 didFinishPickingMediaWithInfo 这很讨厌,只有 95% 可靠

4

1 回答 1

3

我认为问题是您试图在旧视图关闭之前显示新视图?我假设您在显示两个模态视图的父视图控制器中,它是父视图。如果是这种情况,您应该显示新模态视图的点是父视图完全隐藏先前的模态视图。具体来说,这发生在

- (void) viewDidAppear:(BOOL)animated

当然,您需要确保仅在前一个模式视图完成后才显示第二个模式视图(也就是说,当父视图出于任何其他原因出现时不要显示它)

于 2010-03-18T13:40:09.327 回答