Common Macros for RAC

Source: Internet
Author: User

1. RAC action: Used to bind a signal to an attribute of an object, as long as the signal content is generated to assign the content to the property value RAC (_label, text) = _textfield.rac_textsignal;        2.RACObserver (self, name): Whenever the property of this object changes, it generates a signal [Racobserve (Self.view, frame) subscribenext:^ (id x) {    NSLog (@ "changed");     }]; 3. @weak (OBJC) and @strong (OBJC) Role: Resolve each other strong references//not add @ will error
Weak pointers
@weakify (self);
Racsignal *signal = [racsignal createsignal:^racdisposable * (id<racsubscriber> subscriber) {
@strongify (self);
return nil;   }]; 4.RACTuplePack: Wrapping data into ractuple (tuple class) Ractuple *tuple = Ractuplepack (@1, @2);   NSLog (@ "tuple[0] =%@", tuple[0]);     5.RACTupleUnpack: ractuple (Tuple Class) is unpacked into corresponding data//the data in the parameters are packaged into tuples ractuple *tuple = Ractuplepack (@ "XMG", @20); Jiu Baoyuan Group, the value of the tuple, in order to assign a value to the variable inside the parameter//name = @ "XMG" age = @20 ractupleunpack (nsstring *name,nsnumber *age) = tuple;

Common Macros for RAC

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.