我正在将图像文件上传到 FTP,在上传之前我需要检查天气是 png 还是 jpg,如果不是,我应该发出警告警报,我尝试这样做,但它会发出警报它是 jpg 的 png 我如何检查这种情况
NSLog(@"%@",filePath.pathExtension);
if( ![filePath.pathExtension isEqualToString:@"png"] || ![filePath.pathExtension isEqualToString:@"jpg"] || ![filePath.pathExtension isEqualToString:@"PNG"] ||![filePath.pathExtension isEqualToString:@"JPG"] )
{
UIAlertView *alert = [[[UIAlertView alloc]initWithTitle:@"Warning" message:@"Image should be in png or jpg format to upload" delegate:nil cancelButtonTitle:@"Ok" otherButtonTitles:nil, nil]autorelease];
[alert show];
}