PDA

View Full Version : Simple Map error in iOS



chris86kbg
09.11.2014, 14:17
Hi guys,

I would like to integrate a simple map. However, I get the following error.


2014-11-09 13:00:30.719 SimpleAPP[442:24892] +[SKMapView mapStyle]: unrecognized selector sent to class 0x100574498
2014-11-09 13:00:30.722 SimpleAPP[442:24892] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '+[SKMapView mapStyle]: unrecognized selector sent to class 0x100574498'

My Code:

AppDelegate.m


#import <SKMaps/SKMaps.h>

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
SKMapsInitSettings* settings = [[SKMapsInitSettings alloc]init];
[[SKMapsService sharedInstance] initializeSKMapsWithAPIKey:@"xxxxxxx" settings:settings];

return YES;
}

ViewController.h



#import <SKMaps/SKMaps.h>

@interface ViewController : UIViewController <SKMapViewDelegate>
@property(nonatomic,strong) SKMapView *mapView;


ViewController.m



- (void)viewDidLoad
{
[super viewDidLoad];

CGRect viewRect = CGRectMake(0.0f, 0.0f, CGRectGetWidth(self.view.frame), CGRectGetHeight(self.view.frame));
self.mapView = [[SKMapView alloc]initWithFrame:viewRect];
self.mapView.delegate = self;
self.mapView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;


[self.view addSubview:self.mapView];
}


And this part of the tutorial I have explained


</skmapviewdelegate></skmaps>

Drag the SKMapsFrameworkDemo/SKMaps.framework to your project. When prompted, select Copy items into destination group's folder.


Drag the SKMapsResources/SKMaps.bundle to your project. When prompted, select Copy items into destination group's folder. Optionally, drag the SKMapsResources/SKAdvisorResources.bundle to the project, if audio advices for turn by turn navigation are needed.
Select the project and choose your target. Open the Build Phases tab and add the following frameworks in the Link Binary with Libraries section:
UIKit.framework
Foundation.framework
CoreLocation.framework
OpenGLES.framework
QuartzCore.framework
CoreGraphics.framework
libz.dylib
libstdc++.6.dylib
Select the project and choose your target. Choose the Build settings tab and in the Other linker flags option introduce -ObjC.


Import the SKMaps/SKMaps.h header in order to use the library

I am unable to? :(

Thanks Chris

dandronic
11.11.2014, 12:49
Hi Chris,
Are you using any custom styles or just using the default map styles? The "unrecognized selector sent to class" seems to indicate towards a map style issue.

Could you share with us the code for "simpleApp"? If yes, please send it to us via dev@skobbler.com

Thanks,
Dragos

Alex B.
26.03.2015, 10:45
Hi Chris,
maybe the answer is a bit too late for you...
I encountered the same problem and solved it by adding -ObjC as value in Other linker flags in the Build settings.

Greetings Alex