NSLog on devices in iOS 10 / Xcode 8 seems to truncate? Why?
A temporary solution, just redefine all NSLOG
to printf
in a global header file.
#define NSLog(FORMAT, ...) printf("%s\n", [[NSString stringWithFormat:FORMAT, ##__VA_ARGS__] UTF8String]);
iOS10 NSLog is limited to 1024 chars strings
try printf
then instead of NSLog
like,
printf("%s", [string UTF8String]);
It may works
Why are NSLogs in Xcode 8 cut off?
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);
Does XCode ever truncate device's console logs
No, XCode never truncate device's console logs.Also you can view its outputs with your device connected to your Mac and using Xcode Organizer tool.
Note:-
The above point is applicable only to the prior version of Xcode 8
Hide strange unwanted Xcode logs
Try this:
1 - From Xcode menu open: Product
> Scheme
> Edit Scheme
2 - On your Environment Variables set OS_ACTIVITY_MODE
= disable
Related Topics
Dealing With Different iOS Device Resolutions in Spritekit
Xcode 6 Beta 2 Issue Exporting .Ipa: "Your Account Already Has a Valid iOS Distribution Certificate"
How to Scale Down a Uiimage and Make It Crispy/Sharp At the Same Time Instead of Blurry
Detect Current Device With Ui_User_Interface_Idiom() in Swift
Nsurlconnection Using iOS Swift
How to Increase the Height of Navigation Bar in Xcode
How to Scroll the Uiscrollview When the Keyboard Appears
Uicollectionview - Dynamic Cell Height
How to Detect the End of Loading of Uitableview
Shouldautorotatetointerfaceorientation Not Being Called in iOS 6
How Does View Controller Containment Work in iOS 5
Cgcontextdrawimage Draws Image Upside Down When Passed Uiimage.Cgimage
How to Recognize Swipe in All 4 Directions
How to Get the Status of Bluetooth (On/Off) in iPhone Programmatically