Advertisement
Guest User

Untitled

a guest
Dec 8th, 2016
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. NSDataDetector *detector = [NSDataDetector dataDetectorWithTypes:NSTextCheckingAllTypes error:&error];
  2. NSArray *matches = [detector matchesInString:datestring
  3. options:0
  4. range:NSMakeRange(0, [datestring length])];
  5.  
  6.  
  7. for (NSTextCheckingResult *match in matches) {
  8. if ([match resultType] == NSTextCheckingTypeDate) {
  9. dateObj = [match date];
  10. break;
  11. }
  12. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement