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)touchesEnded:(NSSet*)touches withEvent:(UIEvent*)event { | |
| UITouch *touch = [touches anyObject]; | |
| if (CGPointEqualToPoint([touch previousLocationInView:self], [touch locationInView:self])) | |
| [controller toggleToolbars]; | |
| [super touchesEnded:touches withEvent:event]; | |
| } | |
| The resulting stack trace, 2nd time around: | |
| #0 0x00009f84 in -[ScreenshotsScrollView touchesEnded:withEvent:] at ScreenshotsScrollView.m:22 |
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
| // Debug-build only logging macro | |
| #ifdef DEBUG | |
| #define debugLog(format, ...) NSLog((format), ##__VA_ARGS__) | |
| #else | |
| #define debugLog(format, ...) // Nothing | |
| #endif |
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
| # Find the executable from the dsym. | |
| $dsymdir =~ /(.*)\/(.*).dSYM/; | |
| my $pathToDsym = $1; | |
| my $dsymBaseName = $2; | |
| my $executable = $dsymBaseName; | |
| $executable =~ s/\..*//g; # strip off the suffix, if any | |
| chop($executable); | |
| print STDERR "$executable\n"; | |
| # my @paths = glob "$pathToDsym/$dsymBaseName\{,/$executable,/Contents/MacOS/$executable}"; |
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
| [~/somepath][14:57:37 bryan]$ mdfind "com_apple_xcode_dsym_uuids == 6EF8A55A-5697-AF8C-9420-D9AEDE397983" | |
| /Users/bryan/Dropbox/Development/build/Distribution-iphoneos/Equivalence.app.dSYM | |
| /Users/bryan/Dropbox/Development/dSYM_Archive/Distribution/2008-12-07-201354/Equivalence.app.dSYM | |
| [~/somepath][15:00:03 bryan]$ symbolicatecrash -v Equivalence.crash Equivalence.app.dSYM | |
| ...snipsnip... | |
| .............fetching symbol file for Equivalence--[undef] | |
| Searching []...-- NO MATCH | |
| Searching in Spotlight for dsym with UUID of /var/mobile/Applications/FE447955-7BE3-49A5-A272-3D53395DEEEF/Equivalence.app/Equivalence | |
| Running mdfind "com_apple_xcode_dsym_uuids == 6EF8A55A-5697-AF8C-9420-D9AEDE397983" |
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
| #ifdef DEBUG | |
| #define debugLog(...) NSLog(__VA_ARGS__) | |
| #else | |
| #define debugLog(...) // Nothing | |
| #endif |
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
| @implementation NSString (ContactExtension) | |
| - (NSString*)stringFormattedAsPhoneNumber { | |
| NSMutableString *newString = nil; | |
| BOOL prependPlus = NO; | |
| if (!self) | |
| return nil; | |
| if ([self characterAtIndex:0] == '+') |
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
| NSAutoreleasePool *pool = nil; | |
| for (int x = 0; x < 100000; ++x) { | |
| if (x%1000) { | |
| [pool release]; | |
| pool = [[NSAutoreleasePool alloc] init]; | |
| } | |
| // Do memory intensive stuff that adds a lot of stuff to the autorelease pool | |
| } |
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
| NSArray *indexPaths = [NSArray arrayWithObject:[NSIndexPath indexPathForRow:2 inSection:0]]; | |
| [threadTable beginUpdates]; | |
| [threadTable insertRowsAtIndexPaths:indexPaths withRowAnimation:0]; | |
| [threadTable deleteRowsAtIndexPaths:indexPaths withRowAnimation:0]; | |
| [threadTable endUpdates]; |
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
| int cols = 2; | |
| int rows = 3; | |
| float levelData[cols][rows] = {5.66, 11.06, 16.49, 0, 0, 0}; | |
| NSMutableData *writeOut = [NSMutableData dataWithCapacity:cols*rows*sizeof(float)]; | |
| for (int i=0; i < cols; ++i) | |
| [writeOut appendBytes:(void*)levelData[i] length:rows]; | |
| [writeOut writeToFile:somePath atomically:YES]; | |
| NSData *readIn = [NSData dataWithContentsOfFile:somePath]; |
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
| Disclaimer: IMPORTANT: This Apple software is supplied to you by Apple Inc. | |
| ("Apple") in consideration of your agreement to the following terms, and your | |
| use, installation, modification or redistribution of this Apple software | |
| constitutes acceptance of these terms. If you do not agree with these terms, | |
| please do not use, install, modify or redistribute this Apple software. | |
| In consideration of your agreement to abide by the following terms, and subject | |
| to these terms, Apple grants you a personal, non-exclusive license, under | |
| Apple's copyrights in this original Apple software (the "Apple Software"), to | |
| use, reproduce, modify and redistribute the Apple Software, with or without |