This file contains hidden or 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
// Just a string | |
NSString *string = @"Trololololololololololololololololololololololololololololololololololololololololololololololololololololololololololololololololololololololololololololololololololololololololololololololololololololololololololololololololololololololololololololololol"; | |
// Not so clever implicit BOOL cast | |
BOOL hasText = [string length]; // Just add "> 0" to fix it btw. | |
// Sure it has some text! ... eh wait what | |
NSLog(@"String has some text: %@", hasText ? @"YES" : @"NO"); | |
// And to have some reference to the blog post ... (http://blog.bignerdranch.com/564-bools-sharp-corners/) |
This file contains hidden or 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
- (NSURL *)URLWithString:(NSString *)string andQueryValuesForKeys:(NSString *)value, ... { | |
if (!value) { | |
return [NSURL URLWithString:string]; | |
} | |
NSMutableString *queryString = [NSMutableString string]; | |
NSString *argument = nil; | |
NSUInteger argumentCount = 0; | |
va_list argumentList; |
This file contains hidden or 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
On_iPhone(^{ | |
// Some iPhone only code | |
}); | |
On_iPad(^{ | |
// Some iPad only code | |
}); | |
or: |