Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

Make your own iPhone apps
and run them live!
(free)

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Development

Reply
 
LinkBack Thread Tools Display Modes
Old 06-15-2011, 10:38 AM   #1 (permalink)
iPhone Developer
 
alex5776's Avatar
 
Join Date: May 2011
Location: Minnesota
Age: 14
Posts: 26
alex5776 is on a distinguished road
Question Code Crashing - UIImagePicker

Hey everyone!

I have this as my full code, under it I will explain what I am doing, the results, and all that other stuff.

Code:
- (IBAction) launchCameraIBAction:(id)sender{
    
    [self performSelector:@selector(cameralaunchVoid) withObject:NULL afterDelay:.1];
    [activity startAnimating];
    activity.hidden = NO;
    status.text = @"Please wait";
    
    
}
-(void)cameralaunchVoid{
    UIAlertView *notsupported = [[UIAlertView alloc] initWithTitle:@"Sorry..." message:@"Your device does not one of the following: 1. A Camera 2. Supprort for recording video." delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil];
    
    UIImagePickerController *picker = [[UIImagePickerController alloc] init];
    
    
    
    
    if ([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera]) {
        NSArray *sourceTypes = 
        [UIImagePickerController availableMediaTypesForSourceType:picker.sourceType];
        if (![sourceTypes containsObject:(NSString *)kUTTypeMovie ]){
            [notsupported show];
            [notsupported release];
        }
		picker.delegate = self;
        picker.sourceType = UIImagePickerControllerSourceTypeCamera;
        picker.mediaTypes = [NSArray arrayWithObject:(NSString *)kUTTypeMovie];
		[self presentModalViewController:picker animated:YES];
	}
	else {
		[notsupported show];
		[notsupported release];
	}
    activity.hidden = YES;
    [activity stopAnimating];
    
         
}


- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info{
    NSLog(@"Recorded");
        
    next.enabled = YES;
    status.text = @"Video Recorded!";
    [[picker parentViewController]
     dismissModalViewControllerAnimated:YES];
    [picker release];
    tut1.hidden = YES;
                                    
    
     NSFileManager *fileManager = [NSFileManager defaultManager];

    NSData* video = [info objectForKey: UIImagePickerControllerOriginalImage];
    NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); 
    NSString *documentsDirectory = [paths objectAtIndex:0];
    NSURL * docs = [NSURL fileURLWithPath:documentsDirectory]; 

    [video writeToURL:docs atomically:YES];
    
    NSLog(@"Documents directory: %@", 
          [fileManager contentsOfDirectoryAtPath:documentsDirectory error:NULL]);
     
    
}

Ok 1st I start my activity spinner
then I make an error message, but now show it. i then check if the user has a camera, and can record a video. Just so you know I am only supporting video recording. Then I make a UIImagePickerController and show it on the view. Finally In the didFinish.... I dissmis the picker get the NSData (I don't know what else to use) and writeToUrl of my Document Directory.
At the very end I use NSLog to show the contents of that directory.



Errors
After i stop the recording after I have launched the camera, it crashes.
Here is my error message

Code:
2011-06-15 10:35:45.466 Rewinder[1546:707] Store configuration failed. Creating new database. (Error Domain=NSCocoaErrorDomain Code=256 "The operation couldn’t be completed. (Cocoa error 256.)" UserInfo=0x2d9530 {NSUnderlyingException=authorization denied, NSSQLiteErrorDomain=23})
2011-06-15 10:35:45.609 Rewinder[1546:707] Store configuration failed on 2nd attempt: Error Domain=NSCocoaErrorDomain Code=256 "The operation couldn’t be completed. (Cocoa error 256.)" UserInfo=0x2e33e0 {NSUnderlyingException=authorization denied, NSSQLiteErrorDomain=23}
2011-06-15 10:35:45.613 Rewinder[1546:707] *** Assertion failure in +[PLManagedAsset insertInManagedObjectContext:], /SourceCache/PhotoLibraryServices/MobileSlideShow-1194.14/Model/PLPhotoLibrary/Entities/_PLManagedAsset.m:18
I have no idea what it means
It also has a SIGBRT error on that main.m
Code:
int retVal = UIApplicationMain(argc, argv, nil, nil);

Thanks in advanced
__________________
-----------
Want to see me run to the apple store and back?
~~~Moments Later~~~
Want to see me do it again?

Last edited by alex5776; 06-16-2011 at 07:00 AM. Reason: Add info
alex5776 is offline   Reply With Quote
Old 06-16-2011, 01:46 PM   #2 (permalink)
Registered Member
 
Join Date: Jun 2011
Posts: 1
pwightman is on a distinguished road
Default

Hey, are you running iOS 5 beta by chance? I'm getting this exact same problem and it seems odd that this is the ONLY google result that came up when I searched on it. I'm wondering if it has to do with the beta... If you're using iOS 4 then I really don't know what the problem could be though I hope we figure it out!
pwightman is offline   Reply With Quote
Old 06-16-2011, 04:48 PM   #3 (permalink)
Senior Member
iPhone Dev SDK Supporter
 
Join Date: Jan 2010
Location: Issaquah, WA
Age: 42
Posts: 1,244
dljeffery is on a distinguished road
Default

We aren't allowed to discuss iOS betas here.

However, when I suspect something might be a bug related to a beta OS, I go to the ADC forums and search there. I just tried a search on "PLManagedAsset" and got a hit describing this same issue.
__________________
Recall It! Tag your notes. Tag your photos. Tag your thoughts. Tag your life.

Recall It! for iPad

http://www.dljeffery.com
dljeffery is offline   Reply With Quote
Reply

Bookmarks

Tags
code, crash, error, uiimagepicker, video

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Online Users: 313
6 members and 307 guests
chemistry, Dnnake, iOS.Lover, lendo, Leslie80, pbart
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,664
Threads: 94,120
Posts: 402,898
Top Poster: BrianSlick (7,990)
Welcome to our newest member, Leslie80
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 02:24 AM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0