In iOS10 the NSlog are limited to 1024 characters has anybody know a workaround to print complete string.
try printf
then instead of NSLog
like,
printf("%s", [string UTF8String]);
It may works
I thinks this is a same question with [ NSLog on devices in iOS 10 / Xcode 8 seems to truncate? Why?, I will also post my answer here, in case you want to use printf
instead.
This is a temporary solution,since I think it's a bug.
Just redefine all NSLOG
to printf
in a global header file.
#define NSLog(FORMAT, ...) printf("%s\n", [[NSString stringWithFormat:FORMAT, ##__VA_ARGS__] UTF8String]);
a Swift workaround for this new Xcode8 and Sierra “feature”…
func Log(_ format:String, _ args:CVarArg...) {
let output = withVaList(args, { (p) -> NSString in
NSString(format: format, arguments: p)
}) as String
print( output )
}
Of course, this won’t have the features of NSLog that we may require such as the time stamp, bundle name, and thread stuff (including serialization).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With