在 Xcode 中将 Mac 目标添加到 iOS 项目,现在“启动可执行文件时出错”
我决定为我的 iOS 应用程序制作一个 Mac OSX 端口,因此根据我收到的一些建议,我只是将一个新的 Cocoa 目标添加到我的 iOS 项目中,并设置了一系列“库”(它封装了我的应用程序的核心业务逻辑),我已将其添加到 OSX 目标中。我还没有将所有 UIViewController 代码添加到 OSX 目标 - 由于显而易见的原因,我将不得不重写 UI 代码。该应用程序构建良好(没有缺少库的编译器错误等),但由于某种原因,当我尝试运行“hello world”程序时,我收到以下错误消息,我希望在开始之前就开始工作认真编码。这是消息:
Error Starting Executable 'MyExecutableMac'
No executable file found.
Use "file" or "exec-file" command.
根据这个问题,我确保正确的可执行文件已在方案构建设置下列出,以便它实际运行。然而,实际上似乎 .app 文件没有被正确打包 - .app 文件在文件列表中仍然列为“红色”,这意味着该文件丢失。可能是什么原因导致此错误?
I've decided to make a Mac OSX port of my iOS app, so based on a number of suggestions I've received I've simply added a new Cocoa target to my iOS project, and set up a series of 'libraries' (which encapsulate the core business logic of my app) which I have added to the OSX target. I have not added all of the UIViewController code to the OSX target - I will have to rewrite the UI code, for obvious reasons. The app is building fine (no compiler errors for missing libraries, etc.), but for some reason I get the following error message when I try to run the 'hello world' program, which I'd like to get working before I start coding in earnest. Here's the message:
Error Starting Executable 'MyExecutableMac'
No executable file found.
Use "file" or "exec-file" command.
As per this SO question, I made sure that the proper executable file was listed under the scheme build settings, so that it will actually run. However it actually appears that the .app file is not being packaged properly - the .app file is stil listed as "red" in the file list, meaning the file is missing. What might be causing this error?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我在 Xcode 4.2 中遇到了这个问题,我发现首先执行清理(Xcode > Product > Clean 并选择单击 Product > Clean Build Folder...)修复了它。
I had this problem in Xcode 4.2, I found that first doing a clean (Xcode > Product > Clean and option clicking Product > Clean Build Folder…) fixed it.