I have an array which contains NSRange
elements.
Now i can get the last range element of the array using [resultArray lastObject]
.
When i access the last element, It returns some unknown object. (Which means Unknown class)
Now i want to cast the object into NSRange
. How to do it?
My code is:
NSError *error = NULL;
NSRegularExpression *regex = [NSRegularExpression regularExpressionWithPattern:paraStartRegEx options:NSRegularExpressionCaseInsensitive error:&error];
NSArray *matches = [regex matchesInString:content options:0 range:NSMakeRange(0, [content length])];
NSObject *obj = [matches lastObject];
How can I convert this object to NSRange
?