- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我使用 txts 文件中的按钮文本创建 UIActionSheet。将 NSZombieEnabled、NSDebuEnabled 设置为 YES 并将 NSDallocateZombies 设置为 NO 后,我收到一个断点,并显示以下消息:
*** -[CFString isEqual:]: message sent to deallocated instance 0x11fae00
这会在第三次或第四次显示 UIActionSheet 后发生,而不是立即发生。发生这种情况的代码是:
UIActionSheet *actionSheet = [[UIActionSheet alloc] initWithTitle:NSLocalizedStringFromTable( @"text", @"class", @"text" )
delegate:self cancelButtonTitle:nil destructiveButtonTitle:nil
otherButtonTitles:NSLocalizedStringFromTable( @"text1", @"class", @"text1" ),
NSLocalizedStringFromTable( @"text2", @"class", @"text2" ),
NSLocalizedStringFromTable( @"text3", @"class", @"text3" ), nil];
[actionSheet showFromTabBar:self.tabBarController.tabBar];
[actionSheet release];
如果我删除 NSDealocateZombies,模拟器中就不再发生崩溃,但我在控制台中收到警告:
[CFString _cfTypeID]: message sent to deallocated instance
你遇到过这样的问题吗?重复从资源中获取字符串是错误的吗?作为最后一个解决方案,我想将它们放入成员变量中一次,从而避免对相同文本再次调用 NSLocalizedStringFromTable。
最佳答案
最终在其他地方发现了问题:通过 NSLocalizedStringFromTable 获取的 NSString 后来被释放了尽管没有对其进行保留。有趣的是,崩溃发生在系统框架内一个完全不同的类中。所以看来,过度释放才是根本原因。
关于iphone - NSLocalizedStringFromTable 崩溃,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2198576/
我使用 txts 文件中的按钮文本创建 UIActionSheet。将 NSZombieEnabled、NSDebuEnabled 设置为 YES 并将 NSDallocateZombies 设置为
如果你有一个本地化的 iOS 应用程序,比如说,英语和法语,并且你将你的设备设置为德语,NSLocalizedString() 将回退到英语版本的 Localizable.strings,这很好。 如
我正在尝试使用 NSLocalizedStringFromTable 但没有结果。我已经创建了 Profile.strings 文件,点击本地化,在项目设置中我添加了波兰语和英语,所以我的文件里面有
我已经将 REActivityViewController 安装为 pod。这是 pod 中 Resources 文件夹的图片: 这是试图拉弦的其中一行: [_cancelButton set
我是一名优秀的程序员,十分优秀!