次のような URL を指す NSString があります。
https://.../uploads/video/video_file/115/spin_37.mp4
NSString から iOS アプリのファイル名を取得したい (この例では、spin_37.mp4)
私は次のことを試しています:
NSUInteger *startIndex = [self.videoURL rangeOfString:@"/" options:NSBackwardsSearch].location+1;
NSUInteger *endIndex = [self.videoURL length] - startIndex;
NSString *fileName = [self.videoURL substringWithRange:(startIndex, endIndex)];
しかし、私はNSUIntegerで多くのエラーに遭遇しています。つまり、今
Invalid operands to binary expression ('unsigned long' and 'NSUInteger *' (aka 'unsigned long *'))
誰かが私が間違っていることを説明できますか?