- Create a UIView subclass for the pin callout view.
- Create a subclass of MKAnnotationView for your map pins.
- Add an instance of the callout view subclass to your MKAnnotationView subclass.
- Add a property to toggle the callout view to your MKAnnotationView subclass. This example fades in/out:
- (void)setShowCustomCallout:(BOOL)showCustomCallout { [self setShowCustomCallout:showCustomCallout animated:NO]; }
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
// List all fonts on iPhone | |
NSArray *familyNames = [[NSArray alloc] initWithArray:[UIFont familyNames]]; | |
NSArray *fontNames; | |
NSInteger indFamily, indFont; | |
for (indFamily=0; indFamily<[familyNames count]; ++indFamily) | |
{ | |
NSLog(@"Family name: %@", [familyNames objectAtIndex:indFamily]); | |
fontNames = [[NSArray alloc] initWithArray: | |
[UIFont fontNamesForFamilyName: | |
[familyNames objectAtIndex:indFamily]]]; |
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
# http://en.wikipedia.org/wiki/Extreme_points_of_the_United_States#Westernmost | |
top = 49.3457868 # north lat | |
left = -124.7844079 # west long | |
right = -66.9513812 # east long | |
bottom = 24.7433195 # south lat | |
def cull(latlngs): | |
""" Accepts a list of lat/lng tuples. | |
returns the list of tuples that are within the bounding box for the US. | |
NB. THESE ARE NOT NECESSARILY WITHIN THE US BORDERS! |
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
- Copy the delivered ipa into a directory to work in. | |
- export PlistBuddy="/usr/libexec/PlistBuddy" to get the PlistBuddy tool to your shell. If it is not added, all references to PlistBuddy | |
will need to be written as the full path. | |
- Take the delivered App.ipa and unzip it using the unzip command. This should produce a Payload directory containing the app and its | |
resources. | |
- Enter the command "codesign -d --entitlements :enterprise.plist Payload/PathToApp.app/" This pulls the entitlements out of the app, and | |
prints them to a plist, without a leading "blob" of data. Pay particular attention to the colon before the enterprise.plist file name. |
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 NSString *SQLNullValueString = [[NSString alloc] initWithString:@"NULL"]; | |
/* Prototypes */ | |
NSString *SQLWhereClauseForPredictate(NSPredicate *predicate); | |
NSString *SQLExpressionForNSExpression(NSExpression *expression); | |
/* Implementation */ |
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
# Installation | |
brew install ffmpeg --with-vpx --with-vorbis --with-libvorbis --with-vpx --with-vorbis --with-theora --with-libogg --with-libvorbis --with-gpl --with-version3 --with-nonfree --with-postproc --with-libaacplus --with-libass --with-libcelt --with-libfaac --with-libfdk-aac --with-libfreetype --with-libmp3lame --with-libopencore-amrnb --with-libopencore-amrwb --with-libopenjpeg --with-openssl --with-libopus --with-libschroedinger --with-libspeex --with-libtheora --with-libvo-aacenc --with-libvorbis --with-libvpx --with-libx264 --with-libxvid | |
# Easy Peasy | |
ffmpeg -i video.mp4 video.webm |
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 *fontFamilyNames = [UIFont familyNames]; | |
for (NSString *familyName in fontFamilyNames) { | |
NSLog(@"Font Family Name = %@", familyName); | |
NSArray *names = [UIFont fontNamesForFamilyName:familyName]; | |
NSLog(@"Font Names = %@", names); | |
} |
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
NSDateFormatter *formatter = [[NSDateFormatter alloc] init]; | |
[formatter setLocale:[[[NSLocale alloc] initWithLocaleIdentifier:@"en_US_POSIX"] autorelease]]; | |
[formatter setDateFormat:@"MMM d yyyy"]; | |
[formatter setTimeZone:[NSTimeZone timeZoneForSecondsFromGMT:0]]; | |
NSString *string = @__DATE__; | |
NSDate *buildDate = [formatter dateFromString:string]; | |
[formatter release]; |
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
+ (void)combinePDFURLs:(NSArray *)PDFURLs writeToURL:(NSURL *)URL | |
{ | |
CGContextRef context = CGPDFContextCreateWithURL((__bridge CFURLRef)URL, NULL, NULL); | |
for (NSURL *PDFURL in PDFURLs) { | |
CGPDFDocumentRef document = CGPDFDocumentCreateWithURL((__bridge CFURLRef)PDFURL); | |
size_t numberOfPages = CGPDFDocumentGetNumberOfPages(document); | |
for (size_t pageNumber = 1; pageNumber <= numberOfPages; ++pageNumber) { | |
CGPDFPageRef page = CGPDFDocumentGetPage(document, pageNumber); |
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
// Let's initialize the primitives | |
var startTime, endTime, fileSize; | |
// Set up the AJAX to perform | |
var xhr = new XMLHttpRequest(); | |
// Rig the call-back... THE important part | |
xhr.onreadystatechange = function () { | |
// we only need to know when the request has completed |
OlderNewer