iOS: NSString的方法initWithFormat:locale:arguments:

来源:互联网 发布:unity3d 掷骰子 编辑:程序博客网 时间:2024/06/14 17:39

- (id)initWithFormat:(NSString *)format locale:(id)locale arguments:(va_list)argList



va_list myArgs;


 


NSString *myString = [[NSString alloc] initWithFormat:@"%@:  %d\n"


        locale:[[NSUserDefaults standardUserDefaults] dictionaryRepresentation]


        arguments:myArgs];



The resulting string has the value “Cost: 32\n”.


原创粉丝点击