<< | Index | >>
return dictionary instead of multiple values.
UIColor
To create color like a default link
[UIColor colorWithRed:0.2 green:0.33 blue:0.5 alpha:1.0]
use NSRegularExpression to extract registration number from EAN string.
NSError *error = NULL; NSRegularExpression *regex = [NSRegularExpression regularExpressionWithPattern:@"\\b(a|b)(c|d)\\b" options:NSRegularExpressionCaseInsensitive error:&error];
It needs double \
for espace (NSRegularExpression and NSString).
NSString *ean = [NSString stringWithString:[object objectForKey:@"ean"]]; DLog(@"ean = %@",ean) NSError *error = nil; NSRegularExpression *regexp = [NSRegularExpression regularExpressionWithPattern:@"7680(\\d{5}).+" options:0 error:&error]; if (error != nil) { DLog(@"error = %@", error); } else { NSTextCheckingResult *match = [regexp firstMatchInString:ean options:0 range:NSMakeRange(0, ean.length)]; DLog("match count = %i", match.numberOfRanges); if (match.numberOfRanges > 1) { NSString *registrationNumber = [ean substringWithRange:[match rangeAtIndex:1]]; DLog("matched text = %@", registrationNumber); } }
Create Constants class for global static values.
Updated to load this constant.
Class Methods for NSArray:
+ (NSArray *)searchTypes; + (NSArray *)searchLanguages; + (NSArray *)searchLangs; // short names
Updated to search with selected option via NSUserDefaults.