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) present | |
{ | |
CABasicAnimation *a; | |
a = [CABasicAnimation animationWithKeyPath: @"transform.scale"]; | |
a.duration = 6; | |
a.repeatCount = 0; | |
a.autoreverses = NO; | |
a.fromValue = [NSNumber numberWithFloat: 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
// Version 3: Simplified, but still can have an exception thrown in the case of a non-floating point colour space. | |
@implementation NSColor (CGColor) | |
@dynamic CGColor; | |
- (CGColorRef) CGColor | |
{ | |
CGColorSpaceRef colorspace = [[self colorSpace] CGColorSpace]; | |
const NSInteger nComponents = [self numberOfComponents]; |
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
// The Controller: | |
// The controller is created: | |
viewDidLoad: | |
CGRect starsize = CGRectMake(0, 0, 2048, 2048); | |
self.starmap.scrollView.bounds = starsize; | |
self.starmap.frame = starsize; | |
[self.starmap setNeedsDisplay]; |
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
/* | |
This code present a way to implement textView:doCommandBySelector, as sent by an NSTextView to its delegate, and implement the method as - (BOOL) method: (NSTextView*)aTextView and avoid the need for if statement chaining. | |
*/ | |
- (BOOL)textView:(NSTextView *)aTextView doCommandBySelector:(SEL)aSelector { | |
if ([self respondsToSelector: aSelector]) { | |
BOOL (*method)(id, SEL, NSTextView*); | |
method = (BOOL (*)(id, SEL, NSTextView*))[self methodForSelector: aSelector]; | |
return method(self, aSelector, aTextView); | |
} else { |
NewerOlder