iOS6 Simulator MKMapKit Couldn't find default.styleproto in framework
I found a way to consistently reproduce this.
First, the culprit is a set of files in the Cache folder for your simulator. Go to your Application Support folder for the iPhone Simulator:
~/Library/Application Support/iPhone Simulator/[6.0 and above]/Library
Then look inside of your Caches/GeoServices/Resources
You'll see some .styleproto
files in there. These files are only created when MapKit is first used in a simulator. It may also happen on the device, but I haven't confirmed it.
If you want to test this, make sure you have the .styleproto
files, then re-launch your app, and you won't see the warning again when accessing the maps.
Remove the GeoServices
cache folder, quit and restart the simulator (and your app), and there is the warning!
Call Maps for directions from inside your app - iOS5 iOS6
I had a similar problem and I had to create some conditional OS code to deal with the fact that the Google Maps application has been removed. From the new MKMapItem Reference
//first create latitude longitude object
CLLocationCoordinate2D coordinate = CLLocationCoordinate2DMake(latitude,longitude);
//create MKMapItem out of coordinates
MKPlacemark* placeMark = [[MKPlacemark alloc] initWithCoordinate:coordinate addressDictionary:nil];
MKMapItem* destination = [[MKMapItem alloc] initWithPlacemark:placeMark];
if([destination respondsToSelector:@selector(openInMapsWithLaunchOptions:)])
{
//using iOS6 native maps app
[destination openInMapsWithLaunchOptions:@{MKLaunchOptionsDirectionsModeKey:MKLaunchOptionsDirectionsModeDriving}];
}
else
{
//using iOS 5 which has the Google Maps application
NSString* url = [NSString stringWithFormat: @"http://maps.google.com/maps?saddr=Current+Location&daddr=%f,%f", latitude, longitude];
[[UIApplication sharedApplication] openURL: [NSURL URLWithString: url]];
}
[placeMark release];
[destination release];
To get walking directions:
- For iOS 6 maps - You can set
MKLaunchOptionsDirectionsModeWalking
instead ofMKLaunchOptionsDirectionsModeDriving
- For Google maps - Add
&dirflg=w
to the url.
I think it's better to use the openInMapsWithLaunchOptions in iOS6 because it gives you complete control over how the maps application will respond.
ADBannerContentSizeIdentifierPortrait deprecated in iOS6?
With iOS6 came several new updates to the auto-resizing capabilities. Apple no longer wants developers to use the ADBannerContentSizeIdentifierPortrait
and ADBannerContentSizeIdentifierLandscape
techniques, and instead use the auto-resizing capabilities of iOS6.
Similarly, the setCurrentContentSizeIdentifier
and setRequiredContentSizeIdentifiers
are also deprecated.
A pretty good tutorial that I found the other day on auto-resizing in iOS6 can be found here
Related Topics
How to Wait for Method That Has Completion Block (All on Main Thread)
Presenting Uialertcontroller from Uitableviewcell
Apple MACh-O Linker & Ditto Error - Xcode 8
To Change the Color of Unselected Uitabbar Icon in iOS 7
Using Apple's Reachability Class in Swift
Customizing the Mkannotation Callout Bubble
External Framework File/File.H (Parse/Parse.H) File Not Found
Status Bar Visible on iPad Mini Despite Setting Uiviewcontrollerbasedstatusbarappearance to No
Zip and Unzip a File Programmatically in iOS
Autorelease Pools and When Release Is Called Under iOS
Setneedsdisplayinrect: Causes the Whole View to Be Updated
Is It Just the iPhone Simulator That Is Restricted to Intel Only MAC'S
Core Location Not Working in iOS 8
Opening Word,Excel, and PDF Files Without Using Uiwebview on iOS
How to Port "Method_Getimplementation" and "Method_Setimplementation" to Monotouch