使用Skobbler开始导航后,在c ++。字符串文件中的EXC_BAD_ACCESS

时间:2015-04-26 10:52:37

标签: objective-c skmaps

在我更新了我的项目并介绍了Pods之后,我有这个奇怪的错误,只有当我想在路由上开始导航后才能成功计算它。

这是我收到错误的地方,我不知道它是如何实现的,因为我没有对我的代码进行任何重大更改,除了通过CocoaPods在我的项目中使用SKMaps而不是手动拖动它

// char_traits<char>

template <>
struct _LIBCPP_TYPE_VIS_ONLY char_traits<char>
{
typedef char      char_type;
typedef int       int_type;
typedef streamoff off_type;
typedef streampos pos_type;
typedef mbstate_t state_type;

_LIBCPP_INLINE_VISIBILITY
static void assign(char_type& __c1, const char_type& __c2) _NOEXCEPT
    {__c1 = __c2;}
_LIBCPP_INLINE_VISIBILITY
static _LIBCPP_CONSTEXPR bool eq(char_type __c1, char_type __c2) _NOEXCEPT
        {return __c1 == __c2;}
_LIBCPP_INLINE_VISIBILITY
static _LIBCPP_CONSTEXPR bool lt(char_type __c1, char_type __c2) _NOEXCEPT
    {return (unsigned char)__c1 < (unsigned char)__c2;}

_LIBCPP_INLINE_VISIBILITY
static int compare(const char_type* __s1, const char_type* __s2, size_t __n)


    **{return memcmp(__s1, __s2, __n);}** **<------ THIS IS WHERE THE ERROR HAPPENS**



_LIBCPP_INLINE_VISIBILITY
static size_t length(const char_type* __s) {return strlen(__s);}
_LIBCPP_INLINE_VISIBILITY
static const char_type* find(const char_type* __s, size_t __n, const char_type& __a)
    {return (const char_type*)memchr(__s, to_int_type(__a), __n);}
_LIBCPP_INLINE_VISIBILITY
static char_type* move(char_type* __s1, const char_type* __s2, size_t __n)
    {return (char_type*)memmove(__s1, __s2, __n);}
_LIBCPP_INLINE_VISIBILITY
static char_type* copy(char_type* __s1, const char_type* __s2, size_t __n)
    {
        _LIBCPP_ASSERT(__s2 < __s1 || __s2 >= __s1+__n, "char_traits::copy overlapped range");
        return (char_type*)memcpy(__s1, __s2, __n);
    }
_LIBCPP_INLINE_VISIBILITY
static char_type* assign(char_type* __s, size_t __n, char_type __a)
    {return (char_type*)memset(__s, to_int_type(__a), __n);}

_LIBCPP_INLINE_VISIBILITY
static _LIBCPP_CONSTEXPR int_type  not_eof(int_type __c) _NOEXCEPT
    {return eq_int_type(__c, eof()) ? ~eof() : __c;}
_LIBCPP_INLINE_VISIBILITY
static _LIBCPP_CONSTEXPR char_type to_char_type(int_type __c) _NOEXCEPT
    {return char_type(__c);}
_LIBCPP_INLINE_VISIBILITY
static _LIBCPP_CONSTEXPR int_type to_int_type(char_type __c) _NOEXCEPT
    {return int_type((unsigned char)__c);}
_LIBCPP_INLINE_VISIBILITY
static _LIBCPP_CONSTEXPR bool eq_int_type(int_type __c1, int_type __c2) _NOEXCEPT
    {return __c1 == __c2;}
_LIBCPP_INLINE_VISIBILITY
static _LIBCPP_CONSTEXPR int_type  eof() _NOEXCEPT
    {return int_type(EOF);}
};

老实说,我不知道这个文件到底是什么,我不知道为什么会出现这个错误。

这是我用来生成SKMap,创建路线,显示它的代码(直到这一部分,一切正常),但是当我想在计算出的路线上开始导航时,我收到错误

-(void)initMap
{
SKMapView *mapView = [[SKMapView alloc] initWithFrame:CGRectMake( 0.0f, 0.0f,  CGRectGetWidth(self.view.frame), CGRectGetHeight(self.view.frame) )];


[self.view addSubview:mapView];

[SKRoutingService sharedInstance].routingDelegate = self;
[SKRoutingService sharedInstance].navigationDelegate = self;
[SKRoutingService sharedInstance].mapView = mapView;

SKRouteSettings* route = [[SKRouteSettings alloc]init];
route.startCoordinate=![CLLocationCoordinate2DMake][1](39.263671, -103.642420);
route.destinationCoordinate=CLLocationCoordinate2DMake(39.782730, -104.908250);
route.shouldBeRendered = YES; // If NO, the route will not be rendered.
route.numberOfRoutes = 1;
[[SKRoutingService sharedInstance] calculateRoute:route];
}
- (void)routingService:(SKRoutingService *)routingService didFinishRouteCalculationWithInfo:(SKRouteInformation*)routeInformation{
NSLog(@"Route is calculated.");
[routingService zoomToRouteWithInsets:UIEdgeInsetsZero]; // zoom to current route

SKNavigationSettings* navSettings = [SKNavigationSettings navigationSettings];
navSettings.navigationType=SKNavigationTypeSimulation;
navSettings.distanceFormat=SKDistanceFormatMilesFeet;
navSettings.zoomLevelConfigurations = nil;

[SKRoutingService sharedInstance].mapView.settings.displayMode = SKMapDisplayMode3D;
[[SKRoutingService sharedInstance]startNavigationWithSettings:navSettings]; //THIS IS THE LINE THAT TRIGGERS AN ERROR
}
- (void)routingServiceDidFailRouteCalculation:(SKRoutingService *)routingService{
NSLog(@"Route calculation failed.");
}

编辑:主要问题是我无法获得任何堆栈跟踪。这就是全部,我设置了断点来显示所有异常。 这是我收到错误时Xcode屏幕的屏幕截图,而且全部都是:

enter image description here

0 个答案:

没有答案