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 ARSketchView : UIView | |
- (IBAction) clear; | |
- (IBAction) replay; | |
@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 <objc/runtime.h> | |
#import <Foundation/Foundation.h> | |
@interface Person : NSObject | |
@end | |
@implementation Person | |
@end | |
@interface Person(dynamicProperties) |
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 -framework Foundation main.m -o main && ./main | |
int main(int argc, char *argv[]) { | |
@autoreleasepool { | |
NSUInteger (^factorial)(NSUInteger n); | |
NSUInteger (^__block __weak weakFactorial)(NSUInteger n); | |
weakFactorial = factorial = ^ NSUInteger (NSUInteger n) { | |
return n==0 ? 1 : n * weakFactorial(n-1); |
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> | |
#undef X | |
typedef void (^salute_t)(); | |
@interface Person : NSObject | |
@property (nonatomic,copy) NSString *name; | |
@property (nonatomic,copy) salute_t salute; |
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> | |
@interface NSTimer (BlockSupport) | |
+ (NSTimer*)scheduledTimerWithTimeInterval:(NSTimeInterval)interval | |
block:(void(^)())block | |
repeats:(BOOL)repeats; | |
@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
#!/bin/bash | |
# This script builds the iOS and Mac openSSL libraries | |
# It's expanded from https://github.com/st3fan/ios-openssl | |
set -xe | |
# Setup paths to stuff we need | |
OPENSSL_VERSION="1.0.1e" |
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> | |
@interface MySingleton : NSObject | |
+(instancetype) sharedInstance; | |
// clue for improper use (produces compile time error) | |
+(instancetype) alloc __attribute__((unavailable("alloc not available, call sharedInstance instead"))); | |
-(instancetype) init __attribute__((unavailable("init not available, call sharedInstance instead"))); | |
+(instancetype) new __attribute__((unavailable("new not available, call sharedInstance instead"))); |
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
// Not App Store safe. Only available in real devices. | |
#define RTLD_LAZY 0x1 | |
#define RTLD_NOW 0x2 | |
#define RTLD_LOCAL 0x4 | |
#define RTLD_GLOBAL 0x8 | |
NSObject *voiceSynthesizer; | |
void *voiceServices; |
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
#include <objc/runtime.h> | |
#import <Foundation/Foundation.h> | |
@interface Hi : NSObject | |
@end | |
@implementation Hi { | |
NSString *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
#import <Foundation/Foundation.h> | |
#include <stdlib.h> | |
#include <objc/runtime.h> | |
@interface A : NSObject | |
@property (assign) int meaning; | |
@end | |
@implementation A | |