如何解决“Xcode 无法找到源文件”的问题
我正在 Xcode 中使用 ID3 框架(该框架已从网络上消失 - 包括谷歌缓存!)。
我正在测试导入 mp3 功能,该功能允许他们在导入标签时编辑标签。其中一个测试用例是损坏或无效的 mp3,没有正确的 id3 标头。我遇到的问题是,当更新无效 mp3 (updateFile:
) 的标签时,ID3 框架尝试使用 id3V1Tag.m
(我认为它会回退)如果找不到 v2 标签),这就是我收到 Xcode 错误的地方(运行程序时,而不是构建):
Xcode 无法找到源文件:id3V1Tag.m(行:299)< /code>
即使在发布版本中,这也会使程序崩溃,所以我不能真正忽略它。
我尝试在它周围放置一个 try/catch 块,但它不被视为异常,因此不会被捕获。加载文件标签数据的函数返回一个 BOOL,但似乎只有在给定文件不存在时才返回 false,所以这也没有帮助。
当前代码:
[tagData release];
tagData = [[TagAPI alloc] initWithGenreList:nil];
tagsLoaded = [tagData examineFile:exportPath];
if(tagsLoaded) {
[tagData setTitle:title];
[tagData setArtist:artist];
[tagData setComments:comments];
@try {
[tagData updateFile];
}
@catch (id e){
NSLog(@"h");
}
}
I'm working with the ID3 framework in Xcode (which has since disappeared off the face of the web - including google cache!).
I'm testing out an import mp3 feature which allows them to edit the tags as they import them. One of the test cases is a corrupt or invalid mp3 with no proper id3 header. The problem I'm having is that when updating the tags of the invalid mp3 (updateFile:
), the ID3 framework attempts to use id3V1Tag.m
(I assume it falls back to this if it can't find the v2 tag) and this is where I get the Xcode error (whilst running the program, not building):
Xcode could not locate source file: id3V1Tag.m (line: 299)
Even in a release build this crashes the program, so it's not something I can really ignore.
I've tried putting a try/catch block around it but it's not treated as an exception so doesn't get caught. The function to load the tag data for the file returns a BOOL but it appears this only returns false if the given file doesn't exist, so this doesn't help either.
Current code:
[tagData release];
tagData = [[TagAPI alloc] initWithGenreList:nil];
tagsLoaded = [tagData examineFile:exportPath];
if(tagsLoaded) {
[tagData setTitle:title];
[tagData setArtist:artist];
[tagData setComments:comments];
@try {
[tagData updateFile];
}
@catch (id e){
NSLog(@"h");
}
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您收到的错误是 Xcode 正在尝试查找源文件 id3V1Tag.m 以便在调试期间显示它。您编写的任何代码都不会影响这一点。
如果您的框架发行版中没有 id3V1Tag.m 源文件,则您对此无能为力,除了忽略它之外别无选择(除了看看是否可以避免导致它被请求,例如不设置其中的断点,不单步执行,也不崩溃)。
如果您确实拥有它并且正在构建它,那么您可能没有使用正确的调试信息进行构建,因此您必须告诉我们有关您的构建设置的更多信息。
The error you're getting is that Xcode is trying to locate your source file id3V1Tag.m in order to show it during debugging. No code you write will affect this.
If you don't have the id3V1Tag.m source file in your framework distro, there's nothing you can do about this, and there's little to do but ignore it (other than seeing if you can avoid causing it to be requested, like not setting a breakpoint in it, not stepping into it, and not crashing in it).
If you do have it, and are building it, then perhaps you're not building with the right debug information, so you'll have to tell us more about your build setup.
因此,您遇到的问题是,当您尝试编译 id3V1Tag.m 或运行该程序时,您的程序崩溃了。我对此有点困惑。
如果它在运行时崩溃,这可能是库中缺少代码文件的问题?你是如何准确读取ID3标签信息的?是通过您自己的代码还是通过第三方库/类。
So the problem you're having is that your program is crashing when you attempt to compile id3V1Tag.m or while running the program. I'm a bit confused on that.
If its crashing while running maybe this is an issues with a code file missing from a library? How are you reading the ID3 tag information exactly? Is it through your own code or through a 3rd party library/class.