case insensitive checking of suffix of NSString

Viewed 6412

I would like to check if a string has a certain suffix, but would like to do a case insensitive checking. I'd need an alternative for this:

if ([selectedFile hasSuffix:@"jpg"] ||
    [selectedFile hasSuffix:@"JPG"]) 

or jPg, jpG, Jpg. Is there any short way to do this? I don't see how I could apply caseInsensitiveCompare: in this situation.

3 Answers
Related