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
#define KEY @"key" | |
// Set vaulue as a property of obj | |
id obj = [NSObject alloc] init] | |
id value = [[NSObject alloc] init] | |
objc_setAssociatedObject(obj, KEY, value, OBJC_ASSOCIATION_RETAIN_NONATOMIC); | |
// Get that same value from object | |
id value = objc_getAssociatedObject(obj, KEY) |
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
// | |
// BFViewController.m | |
// ObjcRuntimeExample | |
// | |
// Created by Mark Joslin on 3/26/13. | |
// Copyright (c) 2013 BitFountain. All rights reserved. | |
// | |
#import <objc/runtime.h> | |
#import "BFTableViewControler.h" |
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
// | |
// BFViewController.m | |
// ObjcRuntimeExample | |
// | |
// Created by Mark Joslin on 3/26/13. | |
// Copyright (c) 2013 BitFountain. All rights reserved. | |
// | |
#import <objc/runtime.h> | |
#import "BFTableViewControler.h" |
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
^C>> Stopping ... | |
[[:unbind, :connection]] | |
Closing.. | |
[[:error, #<NoMethodError: undefined method `empty?' for nil:NilClass>]] | |
Got error: undefined method `empty?' for nil:NilClass | |
[[:closing, 1000]] | |
[[:sending_frame, :close, "\x03\xE8"]] |
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
less_than(List, Pivot) -> | |
less_than(List, Pivot, []). | |
less_than([], Pivot, Acc) -> | |
Acc; | |
less_than([H|T], Pivot, Acc) when H < Pivot -> | |
less_than(T, Pivot, [H|Acc]); | |
less_than([H|T], Pivot, Acc) when H >= Pivot -> | |
less_than(T, Pivot, Acc). |