【发布时间】:2015-06-14 17:20:57
【问题描述】:
在 Matthew York 的 NSDate+DateTools 中,有一句话让我很崩溃:
#ifndef DateToolsLocalizedStrings
#define DateToolsLocalizedStrings(key) \
NSLocalizedStringFromTableInBundle(key, @"DateTools", [NSBundle bundleWithPath:[[[NSBundle mainBundle] resourcePath] stringByAppendingPathComponent:@"DateTools.bundle"]], nil)
#endif
我将文件从另一个 Xcode 项目移到了这个新的 XCode 项目中。所以我认为它在 mainBundle 中寻找不存在的东西?我不确定发生了什么。谢谢....
【问题讨论】:
-
1.这是 OSX 还是 iOS? 2. 完整的错误信息在哪里,将其添加到问题中。 3.不要使用#define,注意它是多么难以调试。 4.这应该是多语句方法,可能是类方法。 5. 问题是什么?
-
感谢您的快速回复。在我看来,最有可能的情况是 DateTools.bundle 不在我的 App 包中。我该如何检查?
-
如果你没有把它放在那里,它就不在那里。
-
对了,现在有办法在 xcode 中看到这个吗?
-
好的,那么我该如何获取该文件/捆绑包?
标签: objective-c nsdate