I am making a simple gui on Xcode. I use a button to load a text file into an NSArray like below.
NSOpenPanel *panel = [NSOpenPanel openPanel];
if ([panel runModal] == NSFileHandlingPanelOKButton) {
albumURL = [panel URL];
info = [NSString stringWithContentsOfURL: albumURL encoding: NSASCIIStringEncoding error: NULL];
listItems = [info componentsSeparatedByString:@"\n"];
NSString *combinedString = [listItems componentsJoinedByString:@"\n"];
//[self.TrackList setValue:combinedString forKey: combinedString];
}
I want to print the contents of the array into the NSscrollview as a series of strings. I also want to print the context of some specific index into different textfields.
So far I only managed to figure out how to put a set string into the textfield like below.
[self.myTextField setStringValue:@"My string of whatever"];
I'm new to this stuff so if you need more info please ask.