i'd like to know how i can print the contents of a NSDictonary of unknown size fully in a NSTextField? The output should look like this at the end:
Key1: Value
Key2: Value
Key3: Value
.
.
.
KeyN: Value
i'd like to know how i can print the contents of a NSDictonary of unknown size fully in a NSTextField? The output should look like this at the end:
Key1: Value
Key2: Value
Key3: Value
.
.
.
KeyN: Value
NSMutableString *mutableString = [NSMutableString new];
for (id key in myDictionary)
{
[string appendFormat:@"%@: %@\n", key, myDictionary[key]];
}
// Delete last newline
[string deleteCharactersInRange:NSMakeRange([string length]-1, 1)];
myTextField.text = mutableString;