我正在使用ARKit作为我的增强现实应用之一.但我面临的问题是相机中的位置相互重叠.
当我使用硬编码数据尝试它时,我能够在不同位置显示数据.现在我从服务器获取数据并在ARKit上显示它们.这显示了彼此重叠的所有位置.
这是我的代码:
for (NSDictionary *drop in drops)
{
CLLocation *tempLocation = [[CLLocation alloc] initWithLatitude:[[[drop objectForKey:@"latitude"] objectForKey:@"text"] floatValue] longitude:[[[drop objectForKey:@"longitude"] objectForKey:@"text"] floatValue]];
tempCoordinate = [ARGeoCoordinate coordinateWithLocation:tempLocation];
tempCoordinate.inclination = M_PI/30;
tempCoordinate.title = [[drop objectForKey:@"DropText"] objectForKey:@"text"];
tempCoordinate.subtitle = [[drop objectForKey:@"DropPlace"] objectForKey:@"text"];
tempCoordinate.type=[[[drop objectForKey:@"DropType"] objectForKey:@"text"] intValue];
[tempLocationArray addObject:tempCoordinate];
[tempLocation release];
}
[viewController addCoordinates:tempLocationArray];
[viewController startListening];
Run Code Online (Sandbox Code Playgroud)
这显示了所有重叠的液滴.我需要解决方案如何解决这个问题,或者我在这里做错了什么,显示位置一个在另一个上面.请注意,我的情况下所有的水滴都有不同的纬度和经度.我测试过了.
在我的一个项目中,我使用CoreData来存储所有本地数据,它在xcode 5.1.1之前一直运行良好.但随着升级到xcode 6,我开始收到编译错误.错误如下所示:
/Users//Desktop/test/test/test.xcdatamodeld:路径上的数据模型编译失败'/Users//Library/Developer/Xcode/DerivedData/test-bheksmasmjewxsejmxeyasvvhrer/Build/Products/Debug-iphonesimulator/test.app/ test.momd/test.mom"
我尝试搜索SO以解决问题,找到一些建议并在我的项目中实现它们.但这些建议都没有对我有用,我想知道"这个问题是什么.现在任何提示/建议/解决方案都会有很大帮助."
谢谢