开发者

Condition (if) statement pointing to a file extension

开发者 https://www.devze.com 2023-03-08 05:58 出处:网络
Thanks for the help. I need to tell my app.something like: if the input QTmovie has a .whatever 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

精彩评论

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