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 Resizing an Image and Getting Ready to Send

Robin Malhotra
Robin Malhotra
14,883 Points

Checking self.videFilePath

In theory, what if the file path existed but the actual file didn't?(The equivalent of a 404 error on the web, but in the local filesystem). Shouldn't there be a check for that as well?

1 Answer

Robert Bojor
PLUS
Robert Bojor
Courses Plus Student 29,439 Points

Ho Robin,

If you have a look at the imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info method in the documentation you will see that the NSDictionary info contains the path information...

From Apple documentation: "info - A dictionary containing the original image and the edited image, if an image was picked; or a filesystem URL for the movie, if a movie was picked. The dictionary also contains any relevant editing information."

So technically there is no way that the movie will not exist since you pick it from the library, or you film it right now.