开发者

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!

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜