- cljque - Clojure
- ReactiveCocoa - ObjC
- MonoReactive - Mono/.NET
- Reactive Dart - Dart
- Reactive 4 Java - Java
- raix (Reactive And Interactive eXtensions) - ActionScript 3
update_current_git_vars |
function parse_git_branch () { | |
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/' | |
} | |
RED="\[\033[0;31m\]" | |
YELLOW="\[\033[0;33m\]" | |
GREEN="\[\033[0;32m\]" | |
NO_COLOUR="\[\033[0m\]" | |
PS1="$GREEN\u@machine$NO_COLOUR:\w$YELLOW\$(parse_git_branch)$NO_COLOUR\$ " |
@implementation MySharedThing | |
+ (id)sharedInstance | |
{ | |
DEFINE_SHARED_INSTANCE_USING_BLOCK(^{ | |
return [[self alloc] init]; | |
}); | |
} | |
@end |
/* | |
File: KeychainItemWrapper.h | |
Abstract: | |
Objective-C wrapper for accessing a single keychain item. | |
Version: 1.2 - ARCified | |
Disclaimer: IMPORTANT: This Apple software is supplied to you by Apple | |
Inc. ("Apple") in consideration of your agreement to the following | |
terms, and your use, installation, modification or redistribution of |
#import <Foundation/Foundation.h> | |
@interface FOOPSDWriter : NSObject { | |
NSMutableData *data_; | |
NSUInteger location_; | |
} | |
- (void) writeInt64:(UInt64)value; | |
- (void) writeInt32:(UInt32)value; |
CGFloat BNRTimeBlock (void (^block)(void)); |
#import <Foundation/Foundation.h> | |
NSUInteger scannerWordCount(NSString* string) | |
{ | |
NSScanner* scanner = [NSScanner scannerWithString:string]; | |
NSCharacterSet* ws = [NSCharacterSet whitespaceAndNewlineCharacterSet]; | |
NSUInteger words = 0; | |
while ([scanner scanUpToCharactersFromSet:ws intoString:nil]) | |
++words; | |
return words; |
When you have two objects A and B, say two view controllers, that you want to have talk to each other, you can choose from the following options:
-
NSNotificationCenter. This is anonymous one-to-many communication. Object A posts a notification to the NSNotificationCenter, which then distributes it to any other objects listening for that notification, including Object B. A and B do not have to know anything about each other, so this is a very loose coupling. Maybe a little too loose...
-
KVO (Key-Value Observing). One object observes the properties of another. This is a very tight coupling, because Object B is now peeking directly into Object A. The advantage of KVO is that Object A doesn't have to be aware of this at all, and therefore does not need to send out any notifications -- the KVO mechanism takes care of this behind the scenes.
-
Direct pointers. Object A has a pointer to Object B and directly sends it messages when something of interest h
########################################## | |
# | |
# c.f. http://stackoverflow.com/questions/3520977/build-fat-static-library-device-simulator-using-xcode-and-sdk-4 | |
# | |
# Version 2.82 | |
# | |
# Latest Change: | |
# - MORE tweaks to get the iOS 10+ and 9- working | |
# - Support iOS 10+ | |
# - Corrected typo for iOS 1-10+ (thanks @stuikomma) |