取消摄像机视图后重新加载不需要的UITextField

时间:2014-07-08 06:29:03

标签: ios objective-c uitableview uitextfield

我有一个UIActionSheet来实现clickedbuttonAtIndex:

-(void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex
{
    UIImagePickerController *imagePickerController = [[UIImagePickerController alloc]init];
    imagePickerController.navigationBar.translucent = NO;
    imagePickerController.navigationBar.tintColor = [UIColor colorWithHexString:@"#669900"];

    switch (buttonIndex)
    {
        case 0:

            imagePickerController.delegate = self;
            imagePickerController.sourceType =  UIImagePickerControllerSourceTypeCamera;

            [self presentViewController:imagePickerController animated:YES completion:nil];

            break;
        case 1:

            imagePickerController.delegate = self;
            imagePickerController.sourceType =  UIImagePickerControllerSourceTypePhotoLibrary;

            [self presentViewController:imagePickerController animated:YES completion:nil];

            break;
     }
}

其中选项 1 拉出相机,选项 2 拉出用户的照片库。问题是,当您在相机上点击“取消”并返回原始视图时,它会重新加载两个位于主表视图中UITextFields的{​​{1}} UITableViewCell。我不需要看到重装。在照片库视图中点击“取消”时不会发生此活动。

我尝试过使用它:

-(void)viewWillAppear:(BOOL)animated
{
    [super viewDidLoad];
}

- 但这并未预先加载UITextFields

为什么取消按钮重新加载这些UITextFields,我该怎么做才能阻止它?

〜谢谢,Chisx

0 个答案:

没有答案