Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/xcode/7.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
删除文件后,Xcode编译的应用程序不会启动_Xcode_Compilation - Fatal编程技术网

删除文件后,Xcode编译的应用程序不会启动

删除文件后,Xcode编译的应用程序不会启动,xcode,compilation,Xcode,Compilation,我已经在我的项目中添加了一个图像文件(png)。我编译了我的应用程序,一切正常。现在我已经删除了映像文件,清理了构建目标并再次编译。一切都已编译,但应用程序未启动。我看到的只是码头上的一个跳跃图标。Xcode说: __TERMINATING_DUE_TO_UNCAUGHT_EXCEPTION__ 有人能帮我吗?谢谢 以下是调试器所说的(是的,应用程序称为“我的PC加载信”): 我总是对删除的图像/声音/等有问题。。。文件夹。也在VisualStudio中 我使用了图像的文件名作为选项卡视图选项

我已经在我的项目中添加了一个图像文件(png)。我编译了我的应用程序,一切正常。现在我已经删除了映像文件,清理了构建目标并再次编译。一切都已编译,但应用程序未启动。我看到的只是码头上的一个跳跃图标。Xcode说:

__TERMINATING_DUE_TO_UNCAUGHT_EXCEPTION__
有人能帮我吗?谢谢

以下是调试器所说的(是的,应用程序称为“我的PC加载信”):

我总是对删除的图像/声音/等有问题。。。文件夹。也在VisualStudio中


我使用了图像的文件名作为选项卡视图选项卡的标识符,该选项卡是UKPrefsPanel的选项卡视图出口。

检查以确保您的代码中没有引用该文件(或Info.plist)。

如果您放回PNG,它会编译并再次运行吗?如果不是,那么清除构建环境清除了一点太多


啊,更多的评论在Q,所以更多的文本在这一个

“索引(3)超出界限(2)”表明存在索引问题。你在什么地方硬编码过这个索引值吗?还是将索引值存储在配置文件中?我可以想象,例如,您存储了一个文件列表,通过删除PNG,该列表将变小一个项目,但索引可能不会反映这一点,因此它仍然引用不再存在的项目3。
在使用数组的位置检查代码,并确保索引始终在此数组的范围内。当自定义异常超出范围时引发自定义异常,但不要依赖代码自行检查。(换句话说,应用防御性编程。)

不,甚至在xib文件中都没有。问题是我甚至还没有键入一行代码。但我会看一看Xcode生成的代码。是的,你是对的,它是Xcode生成的文件中的索引。太棒了!老实说,我对Xcode一无所知。只是表明良好的编程体验有助于处理更不常见的项目。:-)
[Session started at 2009-08-18 15:06:27 +0200.]
2009-08-18 15:06:27.792 My PC LOAD LETTER[1435:10b] An uncaught exception was raised
2009-08-18 15:06:27.793 My PC LOAD LETTER[1435:10b] *** -[NSCFArray objectAtIndex:]: index (3) beyond bounds (2)
2009-08-18 15:06:27.793 My PC LOAD LETTER[1435:10b] *** Terminating app due to uncaught exception 'NSRangeException', reason: '*** -[NSCFArray objectAtIndex:]: index (3) beyond bounds (2)'
2009-08-18 15:06:27.794 My PC LOAD LETTER[1435:10b] Stack: (
    2494636011,
    2491268667,
    2494635467,
    2494635530,
    2455154639,
    2454620040,
    2467614489,
    2467616211,
    8392,
    2494695413,
    2466250126,
    2466209722,
    2466208028,
    2466207071,
    2466206877,
    2466206028
)

[Session started at 2009-08-18 15:06:27 +0200.]
GNU gdb 6.3.50-20050815 (Apple version gdb-966) (Tue Mar 10 02:43:13 UTC 2009)
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i386-apple-darwin".sharedlibrary apply-load-rules all
Attaching to process 1435.
kill

The Debugger Debugger is attaching to process
[Session started at 2009-08-18 15:06:32 +0200.]
2009-08-18 15:06:32.897 My PC LOAD LETTER[1446:10b] An uncaught exception was raised
2009-08-18 15:06:32.898 My PC LOAD LETTER[1446:10b] *** -[NSCFArray objectAtIndex:]: index (3) beyond bounds (2)
2009-08-18 15:06:32.898 My PC LOAD LETTER[1446:10b] *** Terminating app due to uncaught exception 'NSRangeException', reason: '*** -[NSCFArray objectAtIndex:]: index (3) beyond bounds (2)'
2009-08-18 15:06:32.899 My PC LOAD LETTER[1446:10b] Stack: (
    2494636011,
    2491268667,
    2494635467,
    2494635530,
    2455154639,
    2454620040,
    2467614489,
    2467616211,
    8392,
    2494695413,
    2466250126,
    2466209722,
    2466208028,
    2466207071,
    2466206877,
    2466206028
)

[Session started at 2009-08-18 15:06:32 +0200.]
GNU gdb 6.3.50-20050815 (Apple version gdb-966) (Tue Mar 10 02:43:13 UTC 2009)
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i386-apple-darwin".sharedlibrary apply-load-rules all
Attaching to process 1446.
(gdb)