Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

iOS

Andrew Kelly
Andrew Kelly
4,738 Points

Another Ribbit Question

Hey Guys,

I'm wondering if anyone else has run into an issue with Ribbit hanging when trying to record a video?

I'm pretty much through the whole course with no errors. I just finished the course about viewing Videos within the inbox.

I tried to upload a video to make sure that the code was working as expected and the app ended up freezing.

I don't know if this is something I have done wrong and I am more then willing to post code, I just didn't want to post the whole app right away.

I wasn't sure if it could be my own phone as well. It's near its limit for file sizes and sometimes chugs. It's an iPhone 4S running iOS 7.1

The only other thing I can think of, is that there's an issue with the upload. The problem with that is I'm not seeing any errors on that end as well.

Any help would be appreciated.

Thanks so much, Andrew

Stone Preston
Stone Preston
42,016 Points

when you say it freezes do you get any exception info in the console?

9 Answers

Patrick Donahue
Patrick Donahue
9,523 Points

I GOT IT!

You are missing a curly brace!

 if ([mediaType isEqualToString:(NSString *)kUTTypeImage]) {
        self.image = [info objectForKey:UIImagePickerControllerOriginalImage];

        if (self.imagePicker.sourceType == UIImagePickerControllerSourceTypeCamera) {
            UIImageWriteToSavedPhotosAlbum(self.image, nil, nil, nil);
        }
   } else {

Just need to add it before the "else" statement in the didFinishPickingMedia method.

Stone Preston
Stone Preston
42,016 Points

nice catch. thats so weird it even compiled.

Andrew Kelly
Andrew Kelly
4,738 Points

I am currently getting nothing at all. As soon as I tap on the button "Use Video" the app becomes unresponsive.

If I tapped on "Retake" or "Cancel" buttons before hitting the "Use Video" everything responds as expected. It isn't until I hit the "Use Video" button does it freeze.

So far the only logs I am getting are my own and the only exception comes from the timeout function being deprecated in iOS 7 (Which wasn't there when I posted the question, I had just finished the course)

Thanks for the help Stone.

Stone Preston
Stone Preston
42,016 Points

if you want to put your project on dropbox or github il take a look at it

Stone Preston
Stone Preston
42,016 Points

unfortunately I forgot I dont have a cable with me right now, so I cant test it on a device to test the video. ill take a look later today though and see what happens

Andrew Kelly
Andrew Kelly
4,738 Points

No worries Stone. I just appreciate you taking the time to look at it. It's been a little thing that hasn't stopped me from moving forward but has been bugging me so I thought I'd finally ask today.

I am in no massive rush... again, I just appreciate the help.

Patrick Donahue
Patrick Donahue
9,523 Points

I pulled your code to see if I can help. I cannot save a video - the app freezes and I am not getting anything in the console.

My user name is Patrick - just in case you saw a new user in your database. I am going to set some breakpoints and do some more research. I am using an iPad mini retina 7.1.

Andrew Kelly
Andrew Kelly
4,738 Points

Thanks Patrick! I really appreciate your help.

Stone Preston
Stone Preston
42,016 Points

try removing the lines that save the video to the library in your didFinishPickingMedia method and see what happens.

these are the ones:

if(UIVideoAtPathIsCompatibleWithSavedPhotosAlbum(self.videoPath)) {
                UISaveVideoAtPathToSavedPhotosAlbum(self.videoPath, nil, nil, nil);

            }
Andrew Kelly
Andrew Kelly
4,738 Points

I don't believe that is the solution unfortunately. It has continued to freeze even with the code removed.

Andrew Kelly
Andrew Kelly
4,738 Points

That's so great Patrick! Thanks so much. That was a sneaky one as the indenting totally hide it from me. I really appreciate all your help.

I sent you a video to say as much.

Patrick Donahue
Patrick Donahue
9,523 Points

Not a problem! Thanks for the video - I appreciate it!