开发者

How to store all keys/values of a NSDitionary in a string

开发者 https://www.devze.com 2023-02-14 10:48 出处:网络
I have a NSDictionary object containing key/value pairs. I want to be a开发者_开发知识库ble to out them to a UITextView each in a new line. How would one get about doing that?

I have a NSDictionary object containing key/value pairs. I want to be a开发者_开发知识库ble to out them to a UITextView each in a new line. How would one get about doing that?

Thanks


NSMutableString* str = [NSMutableString string];
for(NSString* key in dict) {
  [str appendFormat: @"%@ - %@\n", key, [dict valueForKey: key]];
}

textView.text = str;
0

精彩评论

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