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
<<<<<<< HEAD | |
<segue reference="kXa-Mw-CAj"/> | |
<segue reference="TDo-lS-nUS"/> | |
<segue reference="hJU-8t-Kde"/> | |
<segue reference="haI-hu-Unh"/> | |
<segue reference="2ra-9a-RvO"/> | |
<segue reference="ixW-dA-JnA"/> | |
======= | |
<segue reference="BwM-Nh-uZ9"/> | |
<segue reference="YWK-Ch-lfU"/> |
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
types = ( | |
"'PDF '", | |
PDF, | |
pdf, | |
"'PICT'", | |
PIC, | |
pic, | |
PCT, | |
pct, | |
PICT, |
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
NSString *filePathInAssetsFolder = [assetURL.path stringByReplacingOccurrencesOfString:self.managedAssetFolderURL.path withString:@""]; | |
NSString *resolution = @"1x"; | |
//strip out the resolution from the filename and use it to populate the resolutions array | |
NSRange lastResolutionOccurrence = [filePathInAssetsFolder rangeOfString:@"@" options:NSBackwardsSearch]; //in case they have the resolution in filename more than once | |
if (lastResolutionOccurrence.location != NSNotFound) { | |
NSString *extension = [filePathInAssetsFolder pathExtension]; | |
NSString *pathUpToResolutionString = [filePathInAssetsFolder substringToIndex:lastResolutionOccurrence.location]; | |
NSRange extensionLocation = [filePathInAssetsFolder rangeOfString:@"." options:NSBackwardsSearch]; |
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
NSMutableParagraphStyle * paragraphStyle = [[NSParagraphStyle defaultParagraphStyle] mutableCopy]; | |
[paragraphStyle setAlignment:NSCenterTextAlignment]; | |
[paragraphStyle setLineBreakMode:NSLineBreakByTruncatingTail]; | |
NSFont *font1 = [NSFont fontWithName:@"HelveticaNeue-Medium" size:12]; | |
NSFont *font2 = [NSFont fontWithName:@"HelveticaNeue-Medium" size:24]; | |
NSDictionary *attributes1 = @{NSFontAttributeName : font1, NSParagraphStyleAttributeName : paragraphStyle}; |
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
Am I out of order being annoyed at things like this? The naming has changed subtly, the direction is at the end in UIKit but at the start on AppKit. If I'm writing cross platform code then I need to either use the int values directly, which is bad practice, or use a define. | |
UIKit: | |
enum { | |
NSTextAlignmentLeft = 0, | |
NSTextAlignmentCenter = 1, | |
NSTextAlignmentRight = 2, | |
NSTextAlignmentJustified = 3, | |
NSTextAlignmentNatural = 4, |
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
NSMutableArray *test = [NSMutableArray array]; | |
if (YES) { | |
NSMutableArray *test = [NSMutableArray array]; | |
[test addObject:@"FOO"]; | |
} | |
NSLog(@"%ld",(long)[test count]); //0, naturally |
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
#import "CLLocation+NHIAdditions.h" | |
@implementation CLLocation (NHIAdditions) | |
- (CGFloat)distanceToPoint:(CLLocation*)pointB | |
{ | |
//uses the haversine formula. http://en.wikipedia.org/wiki/Haversine_formula | |
NSInteger nRadius = 6371; // Earth's radius in Kilometers | |
// Get the difference between our two points then convert the difference into radians | |
CGFloat differenceInLatitudes = (pointB.coordinate.latitude - self.coordinate.latitude) * (M_PI/180); |
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
Error loading /System/Library/Extensions/AudioIPCDriver.kext/Contents/Resources/AudioIPCPlugIn.bundle/Contents/MacOS/AudioIPCPlugIn: dlopen(/System/Library/Extensions/AudioIPCDriver.kext/Contents/Resources/AudioIPCPlugIn.bundle/Contents/MacOS/AudioIPCPlugIn, 262): Symbol not found: ___CFObjCIsCollectable | |
Referenced from: /System/Library/Frameworks/Security.framework/Versions/A/Security | |
Expected in: /DeveloperForiOS5/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation | |
in /System/Library/Frameworks/Security.framework/Versions/A/Security | |
Error loading /System/Library/Extensions/AudioIPCDriver.kext/Contents/Resources/AudioIPCPlugIn.bundle/Contents/MacOS/AudioIPCPlugIn: dlopen(/System/Library/Extensions/AudioIPCDriver.kext/Contents/Resources/AudioIPCPlugIn.bundle/Contents/MacOS/AudioIPCPlugIn, 262): Symbol not found: ___CFObjCIsCollectable | |
Referenced from: /System/Library/Frameworks/Security.framework/Versions/A/Securit |