UIImagePicker in SDK 3.1 and memory leaks

18 views
Skip to first unread message

Zheng Liu

unread,
Oct 12, 2009, 6:10:41 PM10/12/09
to iPhone SDK Development
Hi, guys,

I am using UIImagePicker in my application, but I have two problems
now:

1. Error Msg:
If running my App in SDK 3.1, when I trigger the UIImagePicker, the
console will display an error message but wont effect the App:

Failed to save the videos metadata to the filesystem. Maybe the
information did not conform to a plist.

What does it mean?

2. Memory Leaks:

I found there are many memory leaks from UIImagePicker, I also found
there are many leaks in the example code in class, (Photos).

Any help?

Thanks in advance.

Zheng

CodeWriter

unread,
Oct 13, 2009, 2:03:40 AM10/13/09
to iPhone SDK Development
hello Zheng,

With regard to prob #1:What is your code for saving the video files?
The issue lies with the datatype you are using to write to the
filesytem.

lzbob

unread,
Oct 13, 2009, 1:58:42 PM10/13/09
to iphonesdkd...@googlegroups.com
Hello,

The fact is that I did nothing with the video files, I am using UIImagePicker.

Here is the code:

if([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera]) {
        self.imagePicker.sourceType = UIImagePickerControllerSourceTypeCamera;
    } else {
        self.imagePicker.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;
    }
    self.imagePicker.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;
    self.imagePicker.allowsImageEditing = NO;
    [self presentModalViewController:self.imagePicker animated:YES];

So when execute this code, the console will display that error msg.

Thanks

-z

CodeWriter

unread,
Oct 14, 2009, 1:00:40 AM10/14/09
to iPhone SDK Development
Hello,

By default the source type for the imagepicker is the PhotoLibrary, so
u need not write the else part. Also, no need to define the source
type property for the image picker after your if condition. rest of
the code is allright for capturing the video. If your delegate
"didFinishPickingMediaWithInfo" is implemented correctly, then you
wont have any error in storing the video file. What are your code
lines for the delegate?

deewiles

unread,
Oct 27, 2009, 11:55:41 AM10/27/09
to iPhone SDK Development
I am having a similar issue with the first error message. I am not
dealing with any videos. "Failed to save the videos metadata to the
filesystem. Maybe the
information did not conform to a plist. "

The error is thrown once the UIImagePickerController is presented

[code]

if ([UIImagePickerController isSourceTypeAvailable:
UIImagePickerControllerSourceTypePhotoLibrary]) {

NSLog(@"UIImagePickerControllerSourceTypePhotoLibrary available");

imgPicker = [[UIImagePickerController alloc] init];
imgPicker.delegate = self;
imgPicker.sourceType =
UIImagePickerControllerSourceTypePhotoLibrary;
imgPicker.allowsEditing = YES;

[self.tabBarController presentModalViewController:imgPicker
animated:YES];

}


- (void)imagePickerController:(UIImagePickerController *)picker
didFinishPickingMediaWithInfo:(NSDictionary *)info {

imageView.image = [info
objectForKey:UIImagePickerControllerEditedImage];

[self dismissModalViewControllerAnimated:YES];
}
[/code]

I am compiling against 3.1.2

lzbob

unread,
Oct 28, 2009, 3:52:25 PM10/28/09
to iphonesdkd...@googlegroups.com
It works fine in the device...


-z

deewiles

unread,
Oct 28, 2009, 5:31:47 PM10/28/09
to iPhone SDK Development
Just to confirm you are using 3.1.2?

lzbob

unread,
Oct 28, 2009, 5:36:06 PM10/28/09
to iphonesdkd...@googlegroups.com
my bad.

3.1.2 in simulator has that message.

3.0 on device is fine.


-z

jdandrea

unread,
Nov 25, 2009, 12:12:47 PM11/25/09
to iPhone SDK Development


On Oct 28, 4:36 pm, lzbob <lzb...@gmail.com> wrote:
> my bad.
>
> 3.1.2 in simulator has that message.
>
> 3.0 on device is fine.

3.1.2 on the device (an iPod touch no less) is not fine for me. I get
this same message in the debugger, though it is not an error/exception
per se, just some text logged by the Apple libraries.

Not sure I understand the contention that there are memory leaks in
the image picker. Is it the picker, or something in the class that
invokes the picker?

- JD
Reply all
Reply to author
Forward
0 new messages