【问题标题】:How to overcome CoreAnimation warning while Implementing the Wikitude API in iPhone application?在 iPhone 应用程序中实现 Wikitude API 时如何克服 CoreAnimation 警告?
【发布时间】:2011-03-01 18:38:24
【问题描述】:

我在我的 iPhone 应用程序中使用 Wikiitude API。 但是在运行应用程序时,我收到以下警告,并且在出现此警告时,我无法触摸屏幕上的任何 POI。 警告是“CoreAnimation:忽略异常:CALayer 位置包含 NaN:[nan nan]” 请给我一些建议来克服这个警告。

我正在使用以下代码

wikitudeAR = [[WikitudeARViewController alloc] initWithDelegate:self applicationPackage:nil applicationKey:nil; applicationName:nil developerName:nil];     

- (void) verificationDidSucceed {
    id appDelegate=[[UIApplication sharedApplication]delegate];
    UIWindow *window = [appDelegate window];    
    [window addSubview:[wikitudeAR start];
}

- (void) verificationDidFail {

}

- (void) didUpdateToLocation: (CLLocation*) newLocation
                fromLocation: (CLLocation*) oldLocation {

}

-(void) APIFinishedLoading {   
    //arr is  current location data
    NSMutableArray *addPOIData=[[NSMutableArray alloc]init];
    for(int i=0;i<[arr  count];i++)
    {
        NSDictionary *dict= [arr objectAtIndex:i];
        WTPoi* poi = [[WTPoi alloc] initWithName:currentMapLocation.locationTitle AndLatitude:[[dict objectforKey:@"lat"]doubleValue]AndLongitude:[[dict        objectforKey:@"long"]doubleValue]];
        poi.icon = @"http://img560.imageshack.us/img560/9931/parking.png";
        poi.shortDescription = @"Open Monday to Friday 6:30 to 7pm. Tariff plan range from £5";
        poi.thumbnail = @"http://img560.imageshack.us/img560/9931/parking.png";
        [addPOIData addObject: poi];
        [poi release];
    }

    [[WikitudeARViewController sharedInstance] addPOIs: addPOIData];
    [addPOIData release];
}

提前致谢

【问题讨论】:

  • 我也有以下问题,在我不断将应用程序重新安装到我的 iphone 测试设备后,我的问题似乎发生了......

标签: iphone objective-c calayer


【解决方案1】:

请尝试新版本的 Wikitude iPhone API,它应该可以解决所描述的问题。可以从http://www.wikitude.org/developers下载

干杯,尼古拉斯

【讨论】:

    【解决方案2】:

    我也有以下问题,在我不断将应用程序重新安装到我的 iphone 测试设备后,我的问题似乎发生了......

    尝试以下方法:

    名称限制在 25 个字符左右 将描述限制为 250 个字符 图标和缩略图应该很小 50x50 超过 60x60 在我的情况下会导致相同的错误....

    例子::

    WTPoi* poi25 = [[WTPoi alloc] initWithName:@"Car park: amwell street" AndLatitude:51.52899377167962 AndLongitude:-0.11010333895683289]; 
    poi25.icon = @"http://img560.imageshack.us/img560/9931/parking.png";
    poi25.shortDescription = @"Open Monday to Friday 6:30 to 7pm. Tariff plan range from £5";
    poi25.thumbnail = @"http://img560.imageshack.us/img560/9931/parking.png";
    

    【讨论】:

    • 你是不是越狱了!这个错误真的很奇怪,我的只是有时会在它发生时正常发生我把它放在飞行模式下再次启动应用程序,它就消失了!!
    猜你喜欢
    • 2018-07-24
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-03-04
    • 2011-07-01
    • 1970-01-01
    相关资源
    最近更新 更多