Condition (if) statement pointing to a file extension
Thanks for the help.
I need to tell my app.something like:
if the input QTmovie has a .whatever file extension ...
etc. etc. etc.
I'm doing something like this that recognizes input movie width:
if (movieSize.width =开发者_运维知识库= 1600){
whatever
How would I code a file extension condition?
thanks.
Paul
If you have the full file path as an NSString, you can call pathExtension on it like this:
NSString *extension = [movieFilePath pathExtension];
Then, you'd just add another condition to the if statement, like:
if (movieSize.width == 1600 && [extension isEqualToString:@"mp4"]) {
// do whatever
}
Hope that helps!
精彩评论