在xib资源文件上运行ibtool时出现了NotNotRecognizeSelector异常 [英] doesNotRecognizeSelector exception while running ibtool on a xib resource files
问题描述
任何人都知道为什么我从ibtool那里得到这个崩溃?
Anyone knows why I get this crash from the ibtool?
ibtool --generate-strings-filemy.stringsmyViewController .xib
结果:
2011-04-18 17:49:41.848 ibtoold[32147:107] -[NSCFString count]: unrecognized selector sent to instance 0x20055f7e0
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>com.apple.ibtool.errors</key>
<array>
<dict>
<key>description</key>
<string>Exception while running ibtool: -[NSCFString count]: unrecognized selector sent to instance 0x20055f7e0
Backtrace:
0 0x00007fff81780796 __exceptionPreprocess (in CoreFoundation)
1 0x00007fff8300e0f3 objc_exception_throw (in libobjc.A.dylib)
2 0x00007fff817da110 +[NSObject(NSObject) doesNotRecognizeSelector:] (in CoreFoundation)
3 0x00007fff8175291f ___forwarding___ (in CoreFoundation)
4 0x00007fff8174ea68 _CF_forwarding_prep_0 (in CoreFoundation)
5 0x00000001000ea974 IBAppendStringsfileEntries (in IDEInterfaceBuilderKit)
6 0x00000001000eac4b IBGenerateStringsfile (in IDEInterfaceBuilderKit)
推荐答案
这似乎是新版 ibtool
中的一个错误。在我的例子中,它是一个UISearchBar,其中设置了占位符文本。
This seems to be a bug in the new Version of ibtool
. In my case it was a UISearchBar in which the placeholder text was set.
即使删除占位符文本也无法解决问题,因为Interface Builder会在<$中留下粪便C $ C>的.xib 。完全删除搜索栏并添加新的搜索栏而不设置占位符文本可修复该例外。
Even removing the placeholder text does not resolve the issue, since Interface Builder leaves droppings in the .xib
. Removing the search bar completely and adding a fresh one without setting the placeholder text fixes the exception.
此问题的一种解决方法:使用 $ DEVELOPER_DIR / usr / bin / ibtool3
这似乎是该工具的旧版本。
One workaround for this problem: use $DEVELOPER_DIR/usr/bin/ibtool3
which seems to be the old version of the tool.
这篇关于在xib资源文件上运行ibtool时出现了NotNotRecognizeSelector异常的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!