Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个名为 fireFinalRotate.mp4 的文件,它位于 XCode 项目文件夹中(在 XCode 和 finder 中)。由于某些原因
NSString *path = [[NSBundle mainBundle] pathForResource:@"fireFinalRotate" ofType:@".mp4"];
返回零。任何想法?我很困惑。是因为它是电影文件吗?该代码在 viewDidLoad 中。
您确定在构建应用程序时已将文件包含在构建目标中吗?
右键单击“组和文件”,然后选择“目标成员”项。确保文件旁边有一个复选标记,表明它包含在构建目标中。
我要说 .mp4 不是文件类型,但看起来你已经明白了!
类似于 google 认为 .edu 不是域名但 edu 在指定要搜索的域时起作用的方式