Skip to content

Commit

Permalink
Fixing issue of map not loading until after data save completed
Browse files Browse the repository at this point in the history
  • Loading branch information
radicalrobot committed Oct 11, 2010
1 parent 4478e13 commit cdae749
Show file tree
Hide file tree
Showing 8 changed files with 516 additions and 1,385 deletions.
17 changes: 17 additions & 0 deletions Classes/MapViewController.m
Expand Up @@ -55,6 +55,7 @@ - (void)viewDidLoad {
[self addAnnotations];
}
[super viewDidLoad];
NSLog(@"::END::viewDidLoad");
}

- (void)didReceiveMemoryWarning {
Expand Down Expand Up @@ -130,10 +131,26 @@ -(void) mapView:(MKMapView *)mv annotationView:(MKAnnotationView *)view calloutA
-(void)refresh
{
NSLog(@"refresh");
UIActivityIndicatorView *spinner = [[UIActivityIndicatorView alloc]
initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhiteLarge];

CGRect appFrame = [[UIScreen mainScreen]applicationFrame];
int x = (appFrame.size.width/2) - 16;
int y = (appFrame.size.height/2) - 16;
[spinner setFrame:CGRectMake( x, y, 32, 32)];
[spinner startAnimating];

[[self view] addSubview:spinner];


NSArray *ants = [mapView annotations];
[mapView removeAnnotations:ants];

[self addAnnotations];

[spinner removeFromSuperview];

[spinner release];
NSLog(@"::END:: refresh");
}

Expand Down
2 changes: 1 addition & 1 deletion Classes/OpenPlaquesAppDelegate.h
Expand Up @@ -52,7 +52,7 @@

- (NSString *)applicationDocumentsDirectory;
-(void) createMap;
- (void) parsePlaques;
- (void) parsePlaques:(NSData *)plaqueData;
-(void) storeData;
-(void) storeData:(PlaqueVO *)plaque;
-(void) retrieveData;
Expand Down

0 comments on commit cdae749

Please sign in to comment.