Tell me how to read the file and display it on the label component? Here is the code that I’ve got now, but it always displays (null) .
- (IBAction)listenText:(id)sender { NSFileHandle *file; NSData *databuffer; file = [NSFileHandle fileHandleForReadingAtPath: @"/Users/admin/text.txt.txt"]; if (file == nil) { NSLog(@"Failed to open file"); } NSString* s = [NSString stringWithFormat:@"%@", file]; _labelText.stringValue = s; [file closeFile]; }
NSFileHandlerclass and you still have to do something with it to read the data from the file. Start by reading the developer.apple.com/reference/foundation/nsfilehandle documentation - Max Mikheyenko