This is the URL
assets-library://asset/asset.JPG?id=CF2AF034-9CF7-4472-9185-5EEFA1614A07&ext=JPG
I want to get:
CF2AF034-9CF7-4472-9185-5EEFA1614A07
How would I do that? Is there a method in NSURL that can accomplish this?
This is what I did:
-(NSString *) fgetTokenWithPre:(NSString *) pre andPost:(NSString*) post startSearch:(NSUInteger) start
{
NSRange rangeToSearch;
rangeToSearch.location = start;
rangeToSearch.length =self.length-rangeToSearch.location;
NSRange preRange = [self rangeOfString:self options:NSCaseInsensitiveSearch range:rangeToSearch];
Result
(lldb) po self
$6 = 0x1e54f130 id=00000000-0000-0000-0000-0000000005E9&ext=JPG
(lldb) po pre
$7 = 0x0021d8a0 id=
(lldb) p preRange
(NSRange) $8 = location=0, length=47
But that doesn't make sense. It's obvious that self is 47 length and I am looking for pre that's only 3 length. So how come preRange is [0,47]?