I have a file with a very long text inside. I want to put this text in a NSString with this code:
NSString *myString=[[NSString alloc]initWithContentsOfFile:percorsoFile encoding:NSUTF8StringEncoding error:nil];
This code works fine on Mac OSX 10.8 with Xcode 5, but on my new Mac OSX 10.13 with Xcode 8.3.3, the object myString contains only the first part of the long text.
Is it a NSString problem, or something has changed in the new OSX system which I don’t know? Is there a length limit in NSString object on either OSX 10.13 or Xcode 8.3.3?
The problem is not that myString
is truncated. The problem is that (in code you have not shown) you are using NSLog to examine myString
. It is NSLog that is truncated, not myString
.