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
NSAutoreleasePool *pool = nil; | |
NSString *blah; | |
for (UINT a=0; a<9999999; a++) { | |
if (a%1000==0) { | |
if (pool) { | |
[pool release]; | |
pool = nil; | |
} | |
pool = [[NSAutoreleasePool alloc] init]; | |
} |
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
static OptionsViewController *OVCSharedInstance; | |
+(OptionsViewController*)sharedController { | |
if (!OVCSharedInstance) { | |
OVCSharedInstance = [[OptionsViewController alloc] initWithStyle:UITableViewStyleGrouped]; | |
NSAssert(OVCSharedInstance!=nil,@"Didn't allocate singleton."); | |
} | |
return OVCSharedInstance; | |
} | |
+(id)allocWithZone:(NSZone*)zone { |
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
typedef std::vector<std::vector<char> > charGrid; | |
charGrid *newGrid = new charGrid(); | |
newGrid[0][0] = ' '; | |
// error: no match for 'operator=' in 'newGrid-> std::vector<_Tp, _Alloc>::operator[] [with _Tp = std::vector<char, std::allocator<char> >, _Alloc = std::allocator<std::vector<char, std::allocator<char> > >](0ul) = ' '' |
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
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 |
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
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 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 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 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 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 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" |
OlderNewer