Created
July 21, 2013 01:55
-
-
Save jpweber/6047175 to your computer and use it in GitHub Desktop.
ultimate check for nil from wil shipley
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
if ([pushedCompleteTransaction.manuallySetTransactionDate isKindOfClass:[NSNull class]] | |
|| ([pushedCompleteTransaction.manuallySetTransactionDate respondsToSelector:@selector(length)] | |
&& ![pushedCompleteTransaction.manuallySetTransactionDate respondsToSelector:@selector(count)] | |
&& [(NSData *)pushedCompleteTransaction.manuallySetTransactionDate length] == 0) | |
|| ([pushedCompleteTransaction.manuallySetTransactionDate respondsToSelector:@selector(count)] | |
)){ | |
formattedDate = [dateFormatterIn dateFromString:pushedTransaction.timeStamp]; | |
NSLog(@"using original timestamp"); | |
NSLog(@"using %@ as date", formattedDate); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment