Authored by Hal Mueller

added buttons to SampleMap to exercise -removeAllCachedImages

@@ -21,4 +21,6 @@ @@ -21,4 +21,6 @@
21 @property(nonatomic,retain) IBOutlet UITextField *minZoom; 21 @property(nonatomic,retain) IBOutlet UITextField *minZoom;
22 @property(nonatomic,retain) IBOutlet UITextField *maxZoom; 22 @property(nonatomic,retain) IBOutlet UITextField *maxZoom;
23 23
  24 +- (IBAction)clearSharedNSURLCache;
  25 +- (IBAction)clearMapContentsCachedImages;
24 @end 26 @end
@@ -43,9 +43,9 @@ @@ -43,9 +43,9 @@
43 43
44 [centerLatitude setText:[NSString stringWithFormat:@"%f", mapCenter.latitude]]; 44 [centerLatitude setText:[NSString stringWithFormat:@"%f", mapCenter.latitude]];
45 [centerLongitude setText:[NSString stringWithFormat:@"%f", mapCenter.longitude]]; 45 [centerLongitude setText:[NSString stringWithFormat:@"%f", mapCenter.longitude]];
46 - [zoomLevel setText:[NSString stringWithFormat:@"%f", contents.zoom]];  
47 - [maxZoom setText:[NSString stringWithFormat:@"%f", contents.maxZoom]];  
48 - [minZoom setText:[NSString stringWithFormat:@"%f", contents.minZoom]]; 46 + [zoomLevel setText:[NSString stringWithFormat:@"%.1f", contents.zoom]];
  47 + [maxZoom setText:[NSString stringWithFormat:@"%.1f", contents.maxZoom]];
  48 + [minZoom setText:[NSString stringWithFormat:@"%.1f", contents.minZoom]];
49 49
50 } 50 }
51 51
@@ -69,5 +69,15 @@ @@ -69,5 +69,15 @@
69 [super dealloc]; 69 [super dealloc];
70 } 70 }
71 71
  72 +- (IBAction)clearSharedNSURLCache
  73 +{
  74 + [[NSURLCache sharedURLCache] removeAllCachedResponses];
  75 +}
  76 +
  77 +- (IBAction)clearMapContentsCachedImages
  78 +{
  79 + [contents removeAllCachedImages];
  80 +}
  81 +
72 82
73 @end 83 @end
@@ -19,7 +19,6 @@ @@ -19,7 +19,6 @@
19 - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil { 19 - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil {
20 if (self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]) { 20 if (self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]) {
21 // Custom initialization 21 // Custom initialization
22 - NSLog(@"initWithNibName");  
23 } 22 }
24 return self; 23 return self;
25 } 24 }
@@ -27,7 +26,6 @@ @@ -27,7 +26,6 @@
27 26
28 // Implement viewDidLoad to do additional setup after loading the view, typically from a nib. 27 // Implement viewDidLoad to do additional setup after loading the view, typically from a nib.
29 - (void)viewDidLoad { 28 - (void)viewDidLoad {
30 - NSLog(@"viewDidLoad");  
31 [super viewDidLoad]; 29 [super viewDidLoad];
32 [mapView setDelegate:self]; 30 [mapView setDelegate:self];
33 id myTilesource = [[[RMCloudMadeMapSource alloc] initWithAccessKey:@"0199bdee456e59ce950b0156029d6934" styleNumber:999] autorelease]; 31 id myTilesource = [[[RMCloudMadeMapSource alloc] initWithAccessKey:@"0199bdee456e59ce950b0156029d6934" styleNumber:999] autorelease];
@@ -160,7 +160,7 @@ @@ -160,7 +160,7 @@
160 <bool key="IBUIOpaque">NO</bool> 160 <bool key="IBUIOpaque">NO</bool>
161 <bool key="IBUIClipsSubviews">YES</bool> 161 <bool key="IBUIClipsSubviews">YES</bool>
162 <bool key="IBUIUserInteractionEnabled">NO</bool> 162 <bool key="IBUIUserInteractionEnabled">NO</bool>
163 - <string key="IBUIText">Zoom Minimun</string> 163 + <string key="IBUIText">Zoom Minimum</string>
164 <reference key="IBUITextColor" ref="372796082"/> 164 <reference key="IBUITextColor" ref="372796082"/>
165 <nil key="IBUIHighlightedColor"/> 165 <nil key="IBUIHighlightedColor"/>
166 <int key="IBUIBaselineAdjustment">1</int> 166 <int key="IBUIBaselineAdjustment">1</int>
@@ -226,6 +226,55 @@ @@ -226,6 +226,55 @@
226 <bool key="IBUIEnablesReturnKeyAutomatically">YES</bool> 226 <bool key="IBUIEnablesReturnKeyAutomatically">YES</bool>
227 </object> 227 </object>
228 </object> 228 </object>
  229 + <object class="IBUIButton" id="501755612">
  230 + <reference key="NSNextResponder" ref="249263867"/>
  231 + <int key="NSvFlags">292</int>
  232 + <string key="NSFrame">{{20, 304}, {280, 37}}</string>
  233 + <reference key="NSSuperview" ref="249263867"/>
  234 + <bool key="IBUIOpaque">NO</bool>
  235 + <bool key="IBUIClearsContextBeforeDrawing">NO</bool>
  236 + <int key="IBUIContentHorizontalAlignment">0</int>
  237 + <int key="IBUIContentVerticalAlignment">0</int>
  238 + <object class="NSFont" key="IBUIFont" id="187219318">
  239 + <string key="NSName">Helvetica-Bold</string>
  240 + <double key="NSSize">1.500000e+01</double>
  241 + <int key="NSfFlags">16</int>
  242 + </object>
  243 + <int key="IBUIButtonType">1</int>
  244 + <string key="IBUIHighlightedTitle">Clear shared NSURL cache</string>
  245 + <string key="IBUIDisabledTitle">Clear shared NSURL cache</string>
  246 + <string key="IBUISelectedTitle">Clear shared NSURL cache</string>
  247 + <string key="IBUINormalTitle">Clear shared NSURL cache</string>
  248 + <object class="NSColor" key="IBUIHighlightedTitleColor" id="461177009">
  249 + <int key="NSColorSpace">1</int>
  250 + <bytes key="NSRGB">MSAxIDEAA</bytes>
  251 + </object>
  252 + <object class="NSColor" key="IBUINormalTitleColor">
  253 + <int key="NSColorSpace">1</int>
  254 + <bytes key="NSRGB">MC4xOTYwNzg0MyAwLjMwOTgwMzkzIDAuNTIxNTY4NjYAA</bytes>
  255 + </object>
  256 + </object>
  257 + <object class="IBUIButton" id="543449173">
  258 + <reference key="NSNextResponder" ref="249263867"/>
  259 + <int key="NSvFlags">292</int>
  260 + <string key="NSFrame">{{20, 251}, {280, 37}}</string>
  261 + <reference key="NSSuperview" ref="249263867"/>
  262 + <bool key="IBUIOpaque">NO</bool>
  263 + <bool key="IBUIClearsContextBeforeDrawing">NO</bool>
  264 + <int key="IBUIContentHorizontalAlignment">0</int>
  265 + <int key="IBUIContentVerticalAlignment">0</int>
  266 + <reference key="IBUIFont" ref="187219318"/>
  267 + <int key="IBUIButtonType">1</int>
  268 + <string key="IBUIHighlightedTitle">Clear RouteMe image cache</string>
  269 + <string key="IBUIDisabledTitle">Clear RouteMe image cache</string>
  270 + <string key="IBUISelectedTitle">Clear RouteMe image cache</string>
  271 + <string key="IBUINormalTitle">Clear RouteMe image cache</string>
  272 + <reference key="IBUIHighlightedTitleColor" ref="461177009"/>
  273 + <object class="NSColor" key="IBUINormalTitleColor">
  274 + <int key="NSColorSpace">1</int>
  275 + <bytes key="NSRGB">MC4xOTYwNzg0MyAwLjMwOTgwMzkzIDAuNTIxNTY4NjYAA</bytes>
  276 + </object>
  277 + </object>
229 </object> 278 </object>
230 <string key="NSFrameSize">{320, 460}</string> 279 <string key="NSFrameSize">{320, 460}</string>
231 <reference key="NSSuperview"/> 280 <reference key="NSSuperview"/>
@@ -290,6 +339,24 @@ @@ -290,6 +339,24 @@
290 </object> 339 </object>
291 <int key="connectionID">69</int> 340 <int key="connectionID">69</int>
292 </object> 341 </object>
  342 + <object class="IBConnectionRecord">
  343 + <object class="IBCocoaTouchEventConnection" key="connection">
  344 + <string key="label">clearMapContentsCachedImages</string>
  345 + <reference key="source" ref="543449173"/>
  346 + <reference key="destination" ref="372490531"/>
  347 + <int key="IBEventType">7</int>
  348 + </object>
  349 + <int key="connectionID">77</int>
  350 + </object>
  351 + <object class="IBConnectionRecord">
  352 + <object class="IBCocoaTouchEventConnection" key="connection">
  353 + <string key="label">clearSharedNSURLCache</string>
  354 + <reference key="source" ref="501755612"/>
  355 + <reference key="destination" ref="372490531"/>
  356 + <int key="IBEventType">7</int>
  357 + </object>
  358 + <int key="connectionID">78</int>
  359 + </object>
293 </object> 360 </object>
294 <object class="IBMutableOrderedSet" key="objectRecords"> 361 <object class="IBMutableOrderedSet" key="objectRecords">
295 <object class="NSArray" key="orderedObjects"> 362 <object class="NSArray" key="orderedObjects">
@@ -328,6 +395,8 @@ @@ -328,6 +395,8 @@
328 <reference ref="146305636"/> 395 <reference ref="146305636"/>
329 <reference ref="479071672"/> 396 <reference ref="479071672"/>
330 <reference ref="36853701"/> 397 <reference ref="36853701"/>
  398 + <reference ref="501755612"/>
  399 + <reference ref="543449173"/>
331 </object> 400 </object>
332 <reference key="parent" ref="360949347"/> 401 <reference key="parent" ref="360949347"/>
333 </object> 402 </object>
@@ -381,6 +450,16 @@ @@ -381,6 +450,16 @@
381 <reference key="object" ref="36853701"/> 450 <reference key="object" ref="36853701"/>
382 <reference key="parent" ref="249263867"/> 451 <reference key="parent" ref="249263867"/>
383 </object> 452 </object>
  453 + <object class="IBObjectRecord">
  454 + <int key="objectID">70</int>
  455 + <reference key="object" ref="501755612"/>
  456 + <reference key="parent" ref="249263867"/>
  457 + </object>
  458 + <object class="IBObjectRecord">
  459 + <int key="objectID">76</int>
  460 + <reference key="object" ref="543449173"/>
  461 + <reference key="parent" ref="249263867"/>
  462 + </object>
384 </object> 463 </object>
385 </object> 464 </object>
386 <object class="NSMutableDictionary" key="flattenedProperties"> 465 <object class="NSMutableDictionary" key="flattenedProperties">
@@ -403,6 +482,8 @@ @@ -403,6 +482,8 @@
403 <string>49.IBPluginDependency</string> 482 <string>49.IBPluginDependency</string>
404 <string>50.IBPluginDependency</string> 483 <string>50.IBPluginDependency</string>
405 <string>51.IBPluginDependency</string> 484 <string>51.IBPluginDependency</string>
  485 + <string>70.IBPluginDependency</string>
  486 + <string>76.IBPluginDependency</string>
406 </object> 487 </object>
407 <object class="NSMutableArray" key="dict.values"> 488 <object class="NSMutableArray" key="dict.values">
408 <bool key="EncodedWithXMLCoder">YES</bool> 489 <bool key="EncodedWithXMLCoder">YES</bool>
@@ -424,6 +505,8 @@ @@ -424,6 +505,8 @@
424 <string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string> 505 <string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
425 <string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string> 506 <string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
426 <string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string> 507 <string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
  508 + <string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
  509 + <string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
427 </object> 510 </object>
428 </object> 511 </object>
429 <object class="NSMutableDictionary" key="unlocalizedProperties"> 512 <object class="NSMutableDictionary" key="unlocalizedProperties">
@@ -446,7 +529,7 @@ @@ -446,7 +529,7 @@
446 </object> 529 </object>
447 </object> 530 </object>
448 <nil key="sourceID"/> 531 <nil key="sourceID"/>
449 - <int key="maxID">69</int> 532 + <int key="maxID">78</int>
450 </object> 533 </object>
451 <object class="IBClassDescriber" key="IBDocument.Classes"> 534 <object class="IBClassDescriber" key="IBDocument.Classes">
452 <object class="NSMutableArray" key="referencedPartialClassDescriptions"> 535 <object class="NSMutableArray" key="referencedPartialClassDescriptions">
@@ -462,6 +545,19 @@ @@ -462,6 +545,19 @@
462 <object class="IBPartialClassDescription"> 545 <object class="IBPartialClassDescription">
463 <string key="className">FlipsideViewController</string> 546 <string key="className">FlipsideViewController</string>
464 <string key="superclassName">UIViewController</string> 547 <string key="superclassName">UIViewController</string>
  548 + <object class="NSMutableDictionary" key="actions">
  549 + <bool key="EncodedWithXMLCoder">YES</bool>
  550 + <object class="NSMutableArray" key="dict.sortedKeys">
  551 + <bool key="EncodedWithXMLCoder">YES</bool>
  552 + <string>clearMapContentsCachedImages</string>
  553 + <string>clearSharedNSURLCache</string>
  554 + </object>
  555 + <object class="NSMutableArray" key="dict.values">
  556 + <bool key="EncodedWithXMLCoder">YES</bool>
  557 + <string>id</string>
  558 + <string>id</string>
  559 + </object>
  560 + </object>
465 <object class="NSMutableDictionary" key="outlets"> 561 <object class="NSMutableDictionary" key="outlets">
466 <bool key="EncodedWithXMLCoder">YES</bool> 562 <bool key="EncodedWithXMLCoder">YES</bool>
467 <object class="NSMutableArray" key="dict.sortedKeys"> 563 <object class="NSMutableArray" key="dict.sortedKeys">
@@ -489,7 +585,7 @@ @@ -489,7 +585,7 @@
489 </object> 585 </object>
490 </object> 586 </object>
491 <int key="IBDocument.localizationMode">0</int> 587 <int key="IBDocument.localizationMode">0</int>
492 - <string key="IBDocument.LastKnownRelativeProjectPath">Sample2.xcodeproj</string> 588 + <string key="IBDocument.LastKnownRelativeProjectPath">SampleMap.xcodeproj</string>
493 <int key="IBDocument.defaultPropertyAccessControl">3</int> 589 <int key="IBDocument.defaultPropertyAccessControl">3</int>
494 </data> 590 </data>
495 </archive> 591 </archive>