You must read the text file over the network (local) and display the text on the screen.
Where is it better to place the file - share it on the network or place it on an Apache server? How to open a file from the project folder (how to set the path) and where to put it there?
While something is pointing the way - but the program does not see the file.
Update
NSString* filePath = @"/192.168.1.210/projects/test.txt"; NSString *myText = [NSString stringWithContentsOfFile:filePath encoding:NSUTF8StringEncoding error:nil]; if(myText==nil) [self.textview setText:@"Hello world!!!!"]; else [self.textview setText:myText];
Update 2
NSString* filePath = @"smb://192.168.1.189/Users/dieego/Desktop/share/test.txt"; NSError *error; NSString *ps = [NSString stringWithContentsOfFile:filePath encoding:NSUTF8StringEncoding error: &error]; if(ps==nil) [self.textview setText:[error localizedDescription]]; else [self.textview setText:ps];
This code prints to a textView.
"The operation couldnt be completed (Cocoa error 260)"
NSFileReadNoSuchFileError
- 260 is no file. I will try to reproduce in myself - Max Mikheyenko