Last active
August 29, 2015 14:05
-
-
Save ssoper/6972710ea322e5153277 to your computer and use it in GitHub Desktop.
Using NSUserDefaults to log background pushes, useful for debugging newsstand
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define NSDLOG(fmt, ...) if (![[NSUserDefaults standardUserDefaults] valueForKey: @"LOG"]) { \ | |
[[NSUserDefaults standardUserDefaults] setValue: @"" forKey: @"LOG"]; \ | |
[[NSUserDefaults standardUserDefaults] synchronize]; \ | |
} \ | |
[[NSUserDefaults standardUserDefaults] setValue: [[[NSUserDefaults standardUserDefaults] valueForKey: @"LOG"] stringByAppendingFormat: [@"\n" stringByAppendingString: fmt], ##__VA_ARGS__] forKeyPath: @"LOG"]; \ | |
[[NSUserDefaults standardUserDefaults] synchronize]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment