-1

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?

Max Colla
  • 61
  • 4

1 Answers1

0

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.

matt
  • 515,959
  • 87
  • 875
  • 1,141
  • Hi Matt, thanks for your reply. Yes you are right! myString object isn't truncated. I assume that NSlog has changed from Xcode 5 to Xcode 8.3, because in the 5 version I could read the whole text in the NSlog response without truncation. Anyway I could solve my problem! – Max Colla Oct 23 '18 at 22:33