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)sortMyArray | |
{ | |
NSMutableArray *unsorted = [NSMutableArray arrayWithArray:@[@67, @1, @14, @22, @77, @23, @21, @17, @99, @107, @89, @20]]; | |
NSLog(@"Unsorted:"); | |
NSLog(@"%@",unsorted); | |
NSMutableArray *sorted = [self quickSort:unsorted]; | |
NSLog(@"Sorted:"); | |
NSLog(@"%@",sorted); | |
} |
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
/** | |
Helpful method to dismiss ALL view controllers presented on top of a | |
root view/navigation controller. | |
This method is useful if you have a variable number of view controllers | |
that you'd need to dimiss to return to a base view. Used for my purposes | |
from the AppDelegate class during the process of handling the opening of | |
a URL scheme. | |
This method also relies on implementing a category on UIViewController |
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
# Create an .xcarchive and an .ipa file from the command line (in order to build the ipa without a provisioning profile). | |
# It was build with 2 successive commands, one to create the .xcarchive file, and the second to build the actual ipa file. | |
# Your "SchemeName" here is typically the name of your app. | |
# To create the .xcarchive file: | |
xcodebuild -scheme SchemeName clean archive -archivePath build/SchemeName | |
# To create the .ipa file: | |
xcodebuild -exportArchive -exportFormat ipa -archivePath "build/SchemeName.xcarchive" -exportPath "build/SchemeName.ipa" |
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 *familyNames = [UIFont familyNames]; | |
for ( NSString *familyName in familyNames ) { | |
printf( "Family: %s \n", [familyName UTF8String] ); | |
NSArray *fontNames = [UIFont fontNamesForFamilyName:familyName]; | |
for ( NSString *fontName in fontNames ) { | |
printf( "\tFont: %s \n", [fontName UTF8String] ); | |
} | |
} |
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
- (NSMutableArray *)parseCSVStringIntoArray:(NSString *)csvString { | |
NSMutableArray *csvDataArray = [[NSMutableArray alloc] init]; | |
// break string into an array of individual characters | |
NSMutableArray *characters = [[NSMutableArray alloc] initWithCapacity:[csvString length]]; | |
int csvStringLength = [csvString length]; | |
for (int c=0; c < csvStringLength; c++) { | |
NSString *ichar = [NSString stringWithFormat:@"%c", [csvString characterAtIndex:c]]; | |
[characters addObject:ichar]; |