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

Ribbit Project: Setting videoFilePath change in latest iOS?

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

I get an error stating:

implicit conversion of C pointer type 'CGPathRef' (aka 'const struct CGPath *') to Objective C pointer types NSString requires a bridge cast.

It gives me two ways to fix it. I am guessing I can choose either of them.

However, what's going on exactly?

So far as I can tell, the documentation isn't helping much.

2 Answers

you need to break that line up into two separate lines. replace

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

with

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

check out the teachers notes of this video for more information

Ha! Should have seen the notes. Thanks Stone!