I just installed Xcode 8 and I use NSLogs to see my server response and for other verifications.
However, my NSLogs with my server response (in JSON) are getting cut off.
Any Ideas?
I am using objective-c and running my app on a real device.
Asked
Active
Viewed 1,064 times
3

Bryan Norden
- 2,397
- 18
- 22
-
you mean you can't see full response ? Can you post the response you get ? – Teja Nandamuri Sep 19 '16 at 19:28
-
Yeah I cant view the full response. You can view my full response [link](http://www.jsoneditoronline.org/?id=4ca561ab37dfcfd536d1a652d4ffdd06) – Bryan Norden Sep 19 '16 at 19:59
-
On line 84 on the left side on the JSON online editor you will see this line: "name": "Equipment",but in the logs it gets cuf off after "name": "Equi – Bryan Norden Sep 19 '16 at 20:05
-
In PostMan all my data is there and is also being parsed correctly in the app. – Bryan Norden Sep 19 '16 at 20:07
-
1try `printf` instead of `NSLog` like: `printf("%s", [string UTF8String]);` – TonyMkenu Sep 21 '16 at 11:59
-
That doesn't work for objects. My data changes and has arrays and dictionaries. I also like NSLogs for the extra info it gives – Bryan Norden Sep 22 '16 at 00:22
-
@bryannorden did you fix this? I am facing the same problem and I don't know how to solve it – Asneroll Oct 11 '16 at 08:53
-
@antonio__ check out my answer I posted. Its due to a iOS 10 bug. – Bryan Norden Oct 12 '16 at 15:35
1 Answers
5
I was able to figure this out with the help of This question
You have to create a global header (YourProjectName.pch) Then post this line:
#define NSLog(FORMAT, ...) printf("%s\n", [[NSString stringWithFormat:FORMAT, ##__VA_ARGS__] UTF8String]);
Then you can call NSLog like normal from any view like NSLog(@"My array data: %@", anArray);

Community
- 1
- 1

Bryan Norden
- 2,397
- 18
- 22