Objective-c - Real device test NSProgress does not print progress
黄舟
黄舟 2017-05-02 09:28:09
0
1
611

progress:^(NSProgress * _Nonnull uploadProgress) {
NSLog(@"Progress - %f", uploadProgress.fractionCompleted);
}

During the real machine test, this log cannot be printed, but it works fine on the simulator. The break point in this block will not stop. Why?

黄舟
黄舟

人生最曼妙的风景,竟是内心的淡定与从容!

reply all(1)
Peter_Zhu

A common reason for this situation is redefining NSLog.
Please check if there is code similar to the one below in your project.

#ifdef DEBUG
#define NSLog(format, ...) do {                                                                          \
fprintf(stderr, "<%s : %d> %s\n",                                           \
[[[NSString stringWithUTF8String:__FILE__] lastPathComponent] UTF8String],  \
__LINE__, __func__);                                                        \
(NSLog)( (format), ## __VA_ARGS__ );                                           \
fprintf(stderr, "-------\n");                                               \
} while (0)
#else
#   define NSLog(...)
#endif
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template