您好我有以下代码崩溃应用程序:
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?
我该如何解决这个问题?
提前致谢。
答案 0 :(得分:0)
我的意思是:
NSDictionary *langDict = self.arrayForTableSelLang[indexPath.row];
NSString *string = langDict[kSupport_question_title];
char *cString = [string cStringUsingEncoding:NSISOLatin1StringEncoding];
cell.textLabel.text = [NSString stringWithCString:cString encoding:NSUTF8StringEncoding];
<强>更新强>
以这种方式更新代码:
NSDictionary *langDict = self.arrayForTableSelLang[indexPath.row];
cell.textLabel.text = langDict[kSupport_question_title];