Macros that are common in RAC:use a macro to define a separate import #import <RACEXTScope.h> One.
RAC (TARGET, [KeyPath, [Nil_value]]): Used to bind a property of an object as soon as text box text changes, the text of the label is modified = _textfield.rac_ textsignal;
Two.
Racobserve (self, name): Listens for a property of an object and returns a signal. [Racobserve (Self.view, center) Subscribenext:^ (ID x) { NSLog (@ "%@ ", x); }]; When the Racobserve is placed inside the block must add weakify, regardless of the use of self, otherwise memory leaks, because Racobserve macro inside there is a self @weakify; *signal3 = [Anothersignal flattenmap:^ (Nsarraycontroller *arraycontroller) { avoids a retain cycle because of R Acobserve implicitly referencing self @strongify (self); return Racobserve (Arraycontroller, items); }];
Three.
@weakify (obj) and @strongify (obj), generally two are in use, in the main header file (REACTIVECOCOA.H) is not imported, you need to manually import, RACEXTScope.h can use. But every time the import is very troublesome, just need to import the main header file yourself.
Four.
ractuplepack: Wrapping data into ractuple (tuple Class) wraps the data in the parameter into tuples *tuple = ractuplepack @20 );
Five.
ractupleunpack: Unpack the Ractuple (tuple Class) into corresponding data // wrap the data in the parameter into a tuple ractuple *tuple = Ractuplepack (@ "xmg", @); // Unpacking the tuple, the value of the tuple, in order to assign values to the variables inside the parameter // name = @ "XMG" age = @20 Ractupleunpack (nsstring *name,nsnumber *age) = tuple;
iOS Development Reactivecocoa Learning notes (ii)