私はこれに沿って何かをします:
- (NSString *)getFilenameFrom:(NSString *)string {
NSRange startRange = [string rangeOfString:@"filename="];
if (startRange.location != NSNotFound && startRange.length != NSNotFound) {
int filenameStart = startRange.location + startRange.length;
NSRange endRange = [string rangeOfString:@" " options:NSLiteralSearch range:NSMakeRange(filenameStart, [string length] - filenameStart)];
int filenameLength = 0;
if (endRange.location != NSNotFound && endRange.length != NSNotFound) {
filenameLength = endRange.location - filenameStart;
} else {
filenameLength = [string length] - filenameStart;
}
return [string substringWithRange:NSMakeRange(filenameStart, filenameLength)];
}
return nil; //or return @"", whatever you like
}
ブラウザでこれを作成したので、確認する必要があります(xcode atmにアクセスできません)。