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
# Works best when an Xcode project is already open. | |
# Full Terminal command: | |
cd `osascript -e "tell application \"Xcode\" to get project directory of front project"`; pwd; | |
# Optional: Add this as an alias to .bash_profile. Then type "xt" in Terminal to invoke the command. | |
alias xt='cd `osascript -e "tell application \"Xcode\" to get project directory of front project"`; pwd;' |
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
void ConditionalSwitchUsingNumber(int number); | |
int main(int argc, const char * argv[]) | |
{ | |
@autoreleasepool | |
{ | |
ConditionalSwitchUsingNumber(0); | |
ConditionalSwitchUsingNumber(1); | |
ConditionalSwitchUsingNumber(2); | |
ConditionalSwitchUsingNumber(6); |
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
// Pause app and enter into debugger | |
// Any ambiguous layouts will be labeled | |
po [[UIWindow keyWindow] _autolayoutTrace] |
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
- (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath | |
{ | |
if (indexPath.row % 2 == 0) { | |
UIColor *altCellColor = [UIColor colorWithWhite:0.7 alpha:0.1]; | |
cell.backgroundColor = altCellColor; | |
} | |
} |
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
NSTimeInterval start = [[NSDate date] timeIntervalSince1970]; | |
// Code to execute. | |
NSTimeInterval finish = [[NSDate date] timeIntervalSince1970]; | |
NSLog(@"Execution took %f seconds.", finish - start); |
NewerOlder