【发布时间】:2012-10-16 11:13:18
【问题描述】:
我有一个项目,前段时间合并了 mapbox-ios-sdk。 Mapbox-ios-sdk 已经发生了一些变化,但我也将一些代码侵入其中。所以我尝试将 Mapbox-ios-sdk 从原点合并到我的分支中,经过一番努力,它终于编译好了。但是,我遇到了这个错误:
2012-10-16 19:09:26.466 OfflineSpotty[81420:11f03] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Unable to find LoadingTile.png (copy from framework 'Resources' folder)'
图像已正确添加到左侧窗格中。为什么找不到呢?
编辑:
失败的那一行是:RMRequireAsset(@"LoadingTile.png")
我发现它实际上在 NSAssert 上失败了:
#define RMRequireAsset(asset) NSAssert([[NSBundle mainBundle] pathForResource:[asset stringByReplacingOccurrencesOfString:[@"." stringByAppendingString:[asset pathExtension]] withString:@""] ofType:[asset pathExtension]], @"Unable to find %@ (copy from framework 'Resources' folder)", asset);
还有更完整的消息
`* -[RMLoadingTileView initWithFrame:] 中的断言失败,/Users/t2wu/Documents/Xcode_projects/Open_source/mapbox-ios-sdk/MapView/Map/RMLoadingTileView.m:24 2012-10-16 20:24:58.456 OfflineSpotty[17713:11f03] * 由于未捕获的异常“NSInternalInconsistencyException”而终止应用程序,原因:“无法找到 LoadingTile.png(从框架“资源”文件夹复制)” '
【问题讨论】:
-
不是我不能加载nib,所以我觉得不一样。
-
也许毕竟不是合并问题。我正在检查它在做什么。
-
它只是由于某种原因没有加载。 [[NSBundle mainBundle] pathForResource: @"LoadingTile" ofType:@".png"] 和 [UIImage imageNamed:@"LoadingTile.png"] 都返回 nil。
-
Mapbox-ios-sdk项目中没有copy bundle资源。我添加了文件。但是,这也无济于事。
标签: xcode