0

我有一个 TabBarController,其中一个选项卡有一个 ImageView。此外,我有一个按钮来显示 ImagePicker:

- (IBAction)choosePhoto {
    // Create image picker controller
    UIImagePickerController *imagePicker = [[UIImagePickerController alloc] init];

    // Set source to the camera
    imagePicker.sourceType =  UIImagePickerControllerSourceTypeCamera;

    // Delegate is self
    imagePicker.delegate = self;

    // Allow editing of image ?
    [imagePicker setAllowsEditing:NO];

    // Show image picker
    [tabBarController presentModalViewController:imagePicker animated:NO];

但问题是,当我按下按钮以启动 ImagePicker 时,我收到消息:收到内存警告。级别=1/级别=2。

我试图将代理更改为选项卡的视图,但它也不起作用。

任何的想法?

谢谢

4

1 回答 1

0

内存警告本身不是问题。相机需要大量内存,因此在显示相机界面时系统会生成内存警告是很常见的。只要确保释放尽可能多的内存以响应警告。

于 2010-12-28T19:21:27.637 回答