Syntactic sugar in OC, latest syntax summary, oc syntax sugar Summary

Source: Internet
Author: User

Syntactic sugar in OC, latest syntax summary, oc syntax sugar Summary

<Span style = "font-size: 24px;"> 1. the method is irrelevant to the order. 2. enum {ObjectiveC, Java, Ruby, Python, Erlang}; typedef NSUInteger Language; 3. attribute does not need to be written @ synthesize 4. syntax simplification 4.1 NSNumber * value; value = @ 12345; value = @ 123.45f; value = @ 123.45; value = @ YES; 4.2 NSArray * array; array = @ []; // empty array = @ [a]; // array of an object = @ [a, B, c]; // array of multiple objects 4.3 NSDictionary * dict; dict = @ {}; // Empty dictionary dict =@{ k1: o1}; // dictionary dict containing a key-Value Pair =@{ k1: o1, k2: o2, k3: o3}; // dictionary containing multiple key-value pairs. Note: For variable containers, use NSMutableArray * mutablePlanets = [@ [@ "Mercury", @ "Venus ", @ "Earth", @ "Mars", @ "Jupiter", @ "Saturn", @ "Uranus", @ "Neptune"] mutableCopy]; 5. object subscript can be used to access array and Dictionary data through subscript, similar to the c language structure 5.1 NSArray * array = @ [a, B, c]; id obj = array [I]; // obtain the array object by subscript. Replace the original Syntax: array objectAtIndex: I]; array [I] = NewObj; // You can also assign values to an array object directly. Replace original Syntax: [array replaceObjectAtIndex: I withObject: newObj]; 5.2 NSDictionary * dict =@{ k1: o1, k2: o2, k3: o3 }; id obj = dict [k2]; // obtain the o2 object. Replace the original format with [dic objectForKey: k2]; dic [k2] = newObj; // assign values to objects whose keys are k2 again. Replace the original syntax with [dic setObject: newObj forKey: k2] 6. summary @ # nsnumbers @ {} dictionaries @ "" strings @ [] arrays @ () expressions </span>


Summary of the syntax in SAT OG OC

There are a lot of SAT syntax materials. I 'd like to pick a few of them and send them to you. You can download them from the full score net SAT forum, which is quite comprehensive.
 
Summary of all junior high school grammar?

If the syntax is refined, you can use aofeng! We recommend that you use three sets of grammar for the senior high school entrance exam, including video tutorials, memory outlines and exercises, videos for learning, outlines for memorizing, and exercises for consolidating applications, integration of learning and practice, complete supporting facilities, and comprehensive system. Directly targeting the senior high school entrance exam, it can be said that it is currently recognized as the best syntax materials. Baidu senior high school entrance exam syntax completely broke through or you can find the video on the open English website. After all, the opinions of others are for reference only. You should check whether they are suitable for you.

Related Article

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.