Developer Area

Changeset 795

Show
Ignore:
Timestamp:
01/28/11 15:26:06 (4 years ago)
Author:
henri
Message:

Added calls to willChangeValue for the Key Value Observing to work.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • apps/iphone/my.tel/trunk/Classes/CurrentAccount.m

    r794 r795  
    3939        self = [super init]; 
    4040        // Fill default English versions from file 
     41        [self willChangeValueForKey:@"services"]; 
     42        [self willChangeValueForKey:@"locations"]; 
     43        [self willChangeValueForKey:@"keywords"];        
    4144        _serviceKeys = [[NSMutableDictionary dictionaryWithContentsOfFile:[[NSBundle mainBundle] 
    4245                                                                                                                                           pathForResource:@"ServiceTypes" 
     
    5255        [self didChangeValueForKey:@"keywords"]; 
    5356 
     57        [self willChangeValueForKey:@"timestamp"]; 
    5458        _timestamp = [[NSDate date] retain]; 
    5559        [self didChangeValueForKey:@"timestamp"]; 
     
    5963         
    6064- (void)refreshData { 
    61         [self getServices]; 
     65//      [self getServices]; 
    6266        [self getLocations]; 
    6367        [self getKeywords]; 
     68        [self performSelector:@selector(getServices) withObject:nil afterDelay:30]; 
    6469} 
    6570 
     
    117122                NSArray *serviceKeys = (NSArray *)[parsedJson valueForKey:@"serviceKeys"]; 
    118123                NSDictionary *aKey; 
     124                [self willChangeValueForKey:@"services"]; 
    119125                [_serviceKeys removeAllObjects]; 
    120126                for (aKey in serviceKeys) { 
     
    123129                } 
    124130                [self didChangeValueForKey:@"services"]; 
     131                [self willChangeValueForKey:@"timestamp"]; 
    125132                [_timestamp release]; 
    126133                _timestamp = [[NSDate date] retain]; 
     
    154161                NSArray *liArray = (NSArray *)[parsedJson valueForKey:@"locations"]; 
    155162                NSUInteger i, count = [liArray count]; 
     163                [self willChangeValueForKey:@"services"]; 
    156164                [_locationKeys removeAllObjects]; 
    157165                for (i = 0; i < count; i = i + 2) { 
     
    160168                } 
    161169                [self didChangeValueForKey:@"locations"]; 
     170                [self willChangeValueForKey:@"timestamp"]; 
    162171                [_timestamp release]; 
    163172                _timestamp = [[NSDate date] retain]; 
     
    193202                NSArray *keyTypeList = (NSArray *)[parsedJson valueForKey:@"validKeywordList"]; 
    194203                NSDictionary *aKeyType; 
     204                [self willChangeValueForKey:@"keywords"]; 
    195205                [_keywordKeys removeAllObjects]; 
    196206                for (aKeyType in keyTypeList) { 
     
    199209                } 
    200210                [self didChangeValueForKey:@"keywords"]; 
     211                [self willChangeValueForKey:@"timestamp"]; 
    201212                [_timestamp release]; 
    202213                _timestamp = [[NSDate date] retain]; 
Telnic
Search This Site
Partners
Neustar
ICANN
Main site | WHOIS | Sell .tel | FAQ | Archived Site | About Telnic | Contact Us