Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- NSDataDetector *detector = [NSDataDetector dataDetectorWithTypes:NSTextCheckingAllTypes error:&error];
- NSArray *matches = [detector matchesInString:datestring
- options:0
- range:NSMakeRange(0, [datestring length])];
- for (NSTextCheckingResult *match in matches) {
- if ([match resultType] == NSTextCheckingTypeDate) {
- dateObj = [match date];
- break;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement