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 Build a Self-Destructing Message iPhone App Capturing Photo and Video Using UIImagePickerController Saving the Media

path method

The Path method returns a type CGRef type which is incompatible with the NSString videoFilePath which the instructor set the path as. There is no compile error in the video, but is this because of a new version? and should we use bridge to convert directly?

2 Answers

Stone Preston
Stone Preston
42,016 Points

replace the line thats giving you the warning with this:

    NSURL *imagePickerURL = [info objectForKey:UIImagePickerControllerMediaURL];
    self.videoFilePath = [imagePickerURL path];

you basically have to split that one line into 2 separate lines.

see this forum post for more info

This is the solution, thanks for posting. Hope the tutorial can be updated.

_videoFilePath = [NSString stringWithFormat:@"%@", [[info objectForKey:UIImagePickerControllerMediaURL] path]];