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
import Cocoa | |
let concurrentQueue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0) | |
let serialQueue = dispatch_queue_create("queue", 0) | |
let array = [ "'0'", "'1'", "'2'", "'3'", "'4'", "'5'", "'6'", "'7'", "'8'", "'9'", "'10'" ] | |
for x in 1..10 { | |
let str = array[x]; | |
dispatch_async(serialQueue) { println("serial: \(x) \(str)") } |
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
// New Style. | |
// MyClass.h | |
@interface MyClass : NSObject | |
- (void)foo; | |
@end | |
// MyClass.m |
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
#import <Foundation/Foundation.h> | |
int main(int argc, char **argv) | |
{ | |
@autoreleasepool | |
{ | |
void (^testBlock)(NSString *test) = | |
^(NSString *test) | |
{ | |
NSLog(@"%@", test); |
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
//---------------------------------------- | |
// A.h | |
#import "B.h" | |
@interface A : NSObject | |
@property B *obj; | |
@end | |
// --------------------------------------- | |
// A.m |
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
/* | |
UIStoryboard+PSYStoryboardDelegate.h | |
Created by Remy "Psy" Demarest on 08/06/2013. | |
Copyright (c) 2013. Remy "Psy" Demarest | |
Permission is hereby granted, free of charge, to any person obtaining a copy | |
of this software and associated documentation files (the "Software"), to deal | |
in the Software without restriction, including without limitation the rights | |
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
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
#import <Foundation/Foundation.h> | |
class MyClass { | |
public: | |
MyClass() { NSLog(@"Hello there"); } | |
MyClass(NSString *str) { NSLog(@"Hello %@", str); } | |
}; | |
static MyClass myStatic(@"Outsider"); |
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
#import <objc/runtime.h> | |
#import <Foundation/Foundation.h> | |
@interface Superclass1 : NSObject | |
- (void)testMethod; | |
@end | |
@interface Superclass2 : NSObject | |
- (void)testMethod; |
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
0x103067000 event: (null) | |
| 0x10305b560 event: <OEHIDEvent 0x1025612c0 pad=(null) type=Axis axis=Z direction=Nul value=0.000000 'Z=' cookie=5> | |
| | 0x103069b00 event: <OEHIDEvent 0x10326fd60 pad=(null) type=Button number=16 state=On 'Button 16' cookie=39> | |
| | 0x103069a80 event: <OEHIDEvent 0x103029d90 pad=(null) type=Button number=15 state=On 'Button 15' cookie=38> | |
| | 0x103069a00 event: <OEHIDEvent 0x102381850 pad=(null) type=Button number=14 state=On 'Button 14' cookie=37> | |
| | 0x103069980 event: <OEHIDEvent 0x102537fe0 pad=(null) type=Button number=13 state=On 'Button 13' cookie=36> | |
| | 0x103069900 event: <OEHIDEvent 0x1017392f0 pad=(null) type=Button number=12 state=On 'Button 12' cookie=35> | |
| | 0x103068a90 event: <OEHIDEvent 0x10237a910 pad=(null) type=Button number=8 state=On 'Button 8' cookie=31> | |
| | 0x103068a10 event: <OEHIDEvent 0x10255d000 pad=(null) type=Button number=7 state=On 'Button 7' cookie=30> | |
| | 0x103068990 event: <OEHIDEvent 0x10238ba00 pad=(null) type=Butt |
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
#import <Foundation/Foundation.h> | |
@interface MYClass : NSObject | |
+ (void)errorMethod:(NSObject *(^)(NSObject *))block; | |
+ (void)method:(id(^)(id))block; | |
@end | |
int main(int argc, const char * argv[]) | |
{ | |
@autoreleasepool |
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
#import <objc/runtime.h> | |
#import <Foundation/Foundation.h> | |
@interface NSObject () | |
- (id)objectForKeyedSubscript:(id)key; | |
@end |
NewerOlder