view · edit · sidebar · attach · print · history

20130807-update-generikacc-app-settings

<< | Index | >>


Summary

  • Update settings data-store

Commits / Patches

Index / Status


Update settings view generikacc.app

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]
commit

Update to use settings value for search

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);

    }
  }

links


Create Constants file

Create Constants class for global static values.

NSCFConstantString

Updated to load this constant.

Class Methods for NSArray:

+ (NSArray *)searchTypes;
+ (NSArray *)searchLanguages;
+ (NSArray *)searchLangs; // short names

Update to search with selected option

Updated to search with selected option via NSUserDefaults.

  • Preisvergleich
  • PI
  • FI
commit
view · edit · sidebar · attach · print · history
Page last modified on August 13, 2013, at 03:26 AM