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
| // Add some methods with the runtime. | |
| #import <Foundation/Foundation.h> | |
| #import <objc/runtime.h> | |
| // clang -g -fobjc-arc -Wall -framework Foundation -o addstuff addstuff.m | |
| @interface Glorn : NSObject | |
| @end |
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 <Foundation/Foundation.h> | |
| #import <objc/runtime.h> | |
| // clang -g -fobjc-arc -Wall -framework Foundation -o swizzle swizzle.m | |
| // Swap two methods | |
| void SwizzleMethod (Class clas, SEL originalSelector, SEL newSelector) { | |
| Method originalMethod = | |
| class_getInstanceMethod (clas, originalSelector); |
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
| // | |
| // NSObject+setValuesForKeysWithJSONDictionary.h | |
| // | |
| // Created by Tom Harrington on 12/29/11. | |
| // Tweaked by Mark Dalrymple | |
| // | |
| // Copyright (c) 2011 Atomic Bird, LLC. All rights reserved. | |
| // | |
| #import <Foundation/Foundation.h> |
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 <Foundation/Foundation.h> | |
| // clang -g -Wall -framework Foundation -o trssnd trssnd.m | |
| @interface A : NSObject | |
| @property (assign, readonly, nonatomic) NSInteger blah; | |
| @property (assign, nonatomic) NSInteger hasIvar; |
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 <Foundation/Foundation.h> | |
| #import <objc/runtime.h> | |
| // This stuff won't work with ARC, so make sure it's turned off. | |
| // clang -g -fno-objc-arc -framework Foundation -o indexedivars indexedivars.m | |
| @interface Stuffage : NSObject { | |
| int _extraCount; | |
| } |
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 <Foundation/Foundation.h> | |
| #import <objc/runtime.h> | |
| #import "typestring.h" | |
| // clang -g -fobjc-arc -Wall -framework Foundation -o runtime typestring.m runtime.m | |
| // Runtime reference, at least until Apple breaks the link | |
| // http://developer.apple.com/library/ios/#documentation/Cocoa/Reference/ObjCRuntimeRef/Reference/reference.html |
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 <Foundation/Foundation.h> | |
| #import <objc/runtime.h> | |
| #import "typestring.h" | |
| // clang -g -fobjc-arc -Wall -framework Foundation -o runtime typestring.m runtime.m | |
| // Runtime reference, at least until Apple breaks the link | |
| // http://developer.apple.com/library/ios/#documentation/Cocoa/Reference/ObjCRuntimeRef/Reference/reference.html |
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 <Foundation/Foundation.h> | |
| // clang++ -DCOVER_METHODS=1 -fobjc-arc -g -ObjC++ -Wall -framework Foundation -o machinery machinery.cpp | |
| // clang++ -DFORWARD_INVOCATION=1-fobjc-arc -g -ObjC++ -Wall -framework Foundation -o machinery machinery.cpp | |
| // clang++ -DFORWARDING_TARGET=1-fobjc-arc -g -ObjC++ -Wall -framework Foundation -o machinery machinery.cpp | |
| /* | |
| #define COVER_METHODS 0 | |
| #define FORWARD_INVOCATION 0 | |
| #define FORWARDING_TARGET 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
| #import <Foundation/Foundation.h> | |
| // clang -g -fobjc-arc -Wall -framework Foundation -o marsupial marsupial.m | |
| @interface NSObject (AllThingsCanDance) | |
| - (void) wombatDance: (int) repetitions; | |
| @end | |
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 <Foundation/Foundation.h> | |
| // clang -g -Wall -framework Foundation -o defaults-death defaults-death.m | |
| int main (void) { | |
| @autoreleasepool { | |
| NSUserDefaults *defs = [NSUserDefaults standardUserDefaults]; | |
| NSDictionary *defaultDefaults = @{ | |
| @"spoon" : @"waffle" |