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)clearAllSubviewsOfView :(NSView *)parent { | |
for (NSView *subview in [parent subviews]) { | |
[subview removeFromSuperview]; | |
} | |
} |
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
+ (NSColor *) staticColour { | |
__strong static NSColor* _sharedInstance = nil; | |
static dispatch_once_t onceToken; | |
dispatch_once(&onceToken, ^{ | |
_sharedInstance = [NSColor colorWithCalibratedRed:255.f green:255.f blue:255.f alpha:1.0]; | |
}); | |
return _sharedInstance; | |
} |
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
[_myTextView scrollRangeToVisible:NSMakeRange([[_myTextView string] length], 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
// Numbers | |
NSNumber *x = @(3.14); | |
// Arrays | |
NSArray *a = @[@"a", @"b", @"c"]; | |
// Dictionary | |
NSDictionary *d = @{ @"key" : @"Loris", | |
@"name" : @"Joris", | |
@"n" : @"Boris" }; |
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
- (IBAction)doSomething:(id)sender { | |
NSSegmentedControl *control = (NSSegmentedControl *)sender; | |
NSInteger selectedSeg = [control selectedSegment]; | |
// Do something! | |
} |
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
codesign --verify --verbose=4 <PATH_TO_APP> |
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
# Run this as a post build script, immediately after you copy the sparkle bundle | |
LOCATION="${BUILT_PRODUCTS_DIR}"/"${FRAMEWORKS_FOLDER_PATH}" | |
IDENTITY="Idenitity" # Fill in with code sign identity | |
codesign --deep --verbose --force --sign "$IDENTITY" "$LOCATION/Sparkle.framework/Versions/A" |
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
dmg_vol_name="name" | |
dmg_path="/path/to/final/dmg/$dmg_vol_name.dmg" # Final DMG that you will be shipping | |
dmg_build_path="/path/to/temp/dmg/$dmg_vol_name.dmg" # Temporary DMG that will be worked on and then deleted | |
dmg_volume="/Volumes/$dmg_vol_name" # Should match the mounted name of your DMG. Be sensible and make it the name ;-P | |
hdiutil attach -owners on "dmg_build_path" -shadow | |
bless "$dmg_volume/" --openfolder "$dmg_volume" # This actually makes the change to auto open the DMG in finder | |
hdiutil detach "$dmg_volume" | |
hdiutil convert -format UDZO -o "$dmg_path" "$dmg_build_path" -shadow |
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
[NSURL fileURLWithPath:nsstringPath]; |