【发布时间】:2014-06-26 12:06:10
【问题描述】:
您好,我有以下代码导致应用程序崩溃:
cell.textLabel.text = [NSString stringWithCString:[[[self.arrayForTableSelLang objectAtIndex:indexPath.row] objectForKey:kSupport_question_title] cStringUsingEncoding:NSISOLatin1StringEncoding] encoding:NSUTF8StringEncoding];
错误是:
* Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '* +[NSString stringWithCString:encoding:]: NULL cString
NSLog 给我:
Wie lange dauert es, bis meine Guthaben-Überweisung auf meiner Karte gebucht ist?
我该如何解决这个问题?
提前致谢。
【问题讨论】:
-
如我所见,信息非常清楚。试着把那行代码分成几行,这样你就可以看到原因了。祝你好运。
-
@ArtemStepanenko 你能告诉我如何划分代码吗?或者我的代码有什么问题?
-
@user1954352,我不知道,你的代码有什么问题。因为问题出在提供的线路之外。这与 obj-c 的 ios 无关。这是关于逻辑的。
-
你搞乱了字符串的编码。您不能在 ISO Latin 1 中导出然后再导入 UTF-8,因为这会导致字母混乱。
标签: ios iphone objective-c