我的字符串比较一直返回false,我不明白为什么。即使我的nslog说价值是正确的。你知道为什么即使字符串看起来是相同的,我的比较仍然返回错误吗?如果我通过程序类型显示SV作为其值。我确保这个字符串中没有空格。我们得到的这前两个字符: SV2B799E5B-4306-4965-B5DD-944D3970E6B6NSString子串不会比较
NSString *fPath = [path stringByAppendingPathComponent:[directoryContent objectAtIndex:x]];
NSString *fName = [directoryContent objectAtIndex:x];
NSString *type = [fName substringToIndex:2];
NSLog(@"TYPE: %@",type);
if ([type caseInsensitiveCompare:@"SV"])
{
NSData *file = [[NSData alloc] initWithContentsOfFile:fPath];
if (file)
{
[[WebService sharedWebService]saveVolunteer:nil :YES :[directoryContent objectAtIndex:x] :file];
[file release];
}
}