开发者

NSLocalizedString random problem

i've a strange problem with following code:

NSString *string = NSLocalizedString("hello",nil);

actived by tapping a button. If i use a simple string all ok, if i use the localized string after 1-2 tap on the button the app crash without any error, i really don't unde开发者_开发问答rstand why, can you help me? Thanks.


It's easy to miss: you should use @"hello", not a "hello". NSString* constant must be defined with preceding @.


This works:

NSString *string = NSLocalizedString(@"hello",@"");
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜