Developer Area

Changeset 402

Show
Ignore:
Timestamp:
06/18/09 15:58:16 (5 years ago)
Author:
henri
Message:

Save map tiles in the non-backed-up /Library/Caches.

Location:
apps/iphone/superbook/trunk
Files:
1 added
1 modified

Legend:

Unmodified
Added
Removed
  • apps/iphone/superbook/trunk/Classes/LocateThem_AppDelegate.m

    r363 r402  
    3737-(id)init { 
    3838        if (self = [super init]) { 
     39                // Get rid of old sqlite data in /Documents directory. Now we store the data in /Library/Caches 
     40                NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); 
     41                NSString *documentsDirectory = [paths objectAtIndex:0]; 
     42                NSDirectoryEnumerator *direnum = [[NSFileManager defaultManager] enumeratorAtPath:documentsDirectory]; 
     43                NSString *pname; 
     44                while (pname = [direnum nextObject]) { 
     45                        if ([[pname pathExtension] isEqualToString:@"sqlite"]) { 
     46                                [[NSFileManager defaultManager] removeItemAtPath:[documentsDirectory stringByAppendingPathComponent:pname] error:nil]; 
     47                        } 
     48                } 
     49                 
    3950                //Notifications for tile requests.  This code allows for a class to know when a tile is requested and retrieved 
    4051                [[NSNotificationCenter defaultCenter] addObserver:self 
Telnic
Search This Site
Partners
Neustar
ICANN
Main site | WHOIS | Sell .tel | FAQ | Archived Site | About Telnic | Contact Us