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
- (CAKeyframeAnimation *)negativeShake:(NSRect)frame{ | |
int numberOfShakes = 4; | |
float durationOfShake = 0.5f; | |
float vigourOfShake = 0.05f; | |
CAKeyframeAnimation *shakeAnim = [CAKeyframeAnimation animation]; | |
CGMutablePathRef shakePath = CGPathCreateMutable(); | |
CGPathMoveToPoint(shakePath, NULL, NSMinX(frame), NSMinY(frame)); | |
int index; |
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
Thread 0 Crashed: | |
0 libSystem.B.dylib 0x30c8e0a0 __kill + 8 | |
1 libSystem.B.dylib 0x30c8e090 *_kill | |
2 libSystem.B.dylib 0x30c8e082 raise | |
3 libSystem.B.dylib 0x30ca220a abort | |
4 libstdc++.6.dylib 0x32944a1c __gnu_cxx::__verbose_terminate_handler() + 376 | |
5 libobjc.A.dylib 0x335657c4 _objc_terminate | |
6 libstdc++.6.dylib 0x32942dee __cxxabiv1::__terminate(void (*)()) + 46 | |
7 libstdc++.6.dylib 0x32942e42 std::terminate() + 10 | |
8 libstdc++.6.dylib 0x32942f12 __cxa_throw + 78 |
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
#import "VAUserDefaults.h" | |
@implementation VAUserDefaults | |
- (id)initWithPlist:(NSString *)plist{ | |
if (self = [super init]) { | |
//listen for notifications | |
[[NSDistributedNotificationCenter defaultCenter] addObserver:self selector:@selector(theEvent:) name:@"VAUserDefaultsTo" object:nil]; | |
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 *sortedFirstNames = [firstNames sortedArrayUsingFunction:familyNameCompare context:NULL]; | |
NSInteger familyNameCompare(NSString *one, NSString *two, void *context) | |
{ | |
NSArray *sortedFamilyNames = [[FirstNamesAndFamilyNames allValues] sortedArrayUsingSelector:@selector(caseInsensitiveCompare:)]; | |
NSString *oneName = [FirstNamesAndFamilyNames objectForKey:one]; | |
NSString *twoName = [FirstNamesAndFamilyNames objectForKey:two]; |
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
@interface VAImage : UIView <VAUrlConnectionDelegate> { | |
VAUrlConnection *conn; | |
} | |
- (void) connectionDidFinish:(VAUrlConnection *)theConnection; | |
@implementation VAImage |
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)applicationDidFinishLaunching:(NSNotification *)aNotification { | |
//create a example nested dictionary with just 4 levels | |
NSMutableDictionary *parent = [[[NSMutableDictionary alloc] init] autorelease]; | |
NSDictionary *thirdChild = [NSDictionary dictionaryWithObjectsAndKeys:@"bi",@"l4",@"nar",@"l4_", nil]; | |
NSDictionary *secondChild = [NSDictionary dictionaryWithObjectsAndKeys:thirdChild,@"l3",@"bar",@"l3_", nil]; | |
NSDictionary *firstChild = [NSDictionary dictionaryWithObjectsAndKeys:secondChild,@"l2",secondChild,@"l2_", nil]; | |
[parent setObject:firstChild forKey:@"l1"]; | |
[parent setObject:firstChild forKey:@"l1_"]; | |
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
#import "DetailsDataSource.h" | |
@implementation DetailsDataSource | |
@synthesize rootItems; | |
- (id)init | |
{ | |
self = [super init]; |
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 *ivarPrevious = [NSMutableArray arrayWithCapacity:1]; | |
-(void)foo | |
{ | |
NSMutableArray *newivarPrevious = [NSMutableArray arrayWithCapacity:1]; | |
for (...){ | |
NSMutableDictionary *ret = [NSMutableDictionary dictionaryWithCapacity:1]; | |
[ret setObject:foo forKey:@"foo"]; | |
[ret setObject:bar forKey:@"bar"]; | |
[newivarPrevious addObject:[ret description]]; |
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
@interface AppDelegate : NSObject <NSApplicationDelegate> { | |
NSMutableString *retainedProperty; //explicitly declaring ivar backing is only required for the 32 bit runtime, is automatically added by the compiler for 64 bit | |
} | |
@property (retain) NSMutableString *retainedProperty; | |
@end | |
@implementation AppDelegate |
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
NSString *foo = @"foo"; | |
NSString *bar = [NSString stringWithString:@"bar"]; | |
NSString *baz = [[NSString alloc] initWithString:@"baz"]; | |
NSMutableString *bax = [NSMutableString stringWithString:@"bax"]; | |
NSData *objData = [NSData dataWithBytes:foo length:malloc_size(foo)]; | |
NSLog(@"%s foo contains %@, hash %lu, retain %i",class_getName(object_getClass(foo)),objData,[foo hash],[foo retainCount]); | |
objData = [NSData dataWithBytes:bar length:malloc_size(bar)]; | |
NSLog(@"%s bar contains %@, hash %lu, retain %i",class_getName(object_getClass(bar)),objData,[bar hash],[bar retainCount]); |
OlderNewer