Ios basics-XCode tips

Source: Internet
Author: User

(1) pragma mark

1. Definition

# The code starting with pragma is a compiler instruction, which is a program or compiler-specific instruction. Not necessarily applicable to other compilers or other environments. If the compiler cannot recognize this instruction, it will ignore it.

2. Role
At the top of the editor pane, separate the code from the function pop-up menu to standardize the code for easy reading and searching.

3. Use

Add # pragma mark-

# Pragma mark-when the view is to be displayed-(void) viewWillAppear :( BOOL) animated {// initializes the array of the selected number/* clears the selected betting ball group each time it is switched to rootview */DataModel * datamodel = [DataModel 1_datasource]; datamodel. bils = [[NSMutableArray alloc] init];}


<喎?http: www.bkjia.com kf ware vc " target="_blank" class="keylink"> VcD4KPHA + signature + CjwvcD4KPHA + signature/Signature + CjxwPrS0vai/Signature + signature/Signature + 0MK9qNK7z + signature/Signature + signature/ c23uvOjrM3PyOtjb2RlIHNuaXBwZXQgbGlicmFyeTwvcD4KPHA + pgltzybzcm9 "http://www.2cto.com/uploadfile/Collfiles/20140618/201406180900384.jpg" alt = "\">

Successfully created. Drag the code snippet library to the bottom, modify the name, and add a shortcut key.


At this point, the creation is successful. If you enter pm in the class, a prompt is displayed.


Press enter to automatically complete

In addition, I have created three more quick operations.

Title: NSLog Completion Shortcut: log Completion Scopes: Function or Method   NSLog(@"<#Log#>");

Title: Property Strong Completion Shortcut: ps Completion Scopes: All   @property (strong, nonatomic) 

Title: Property Assign Completion Shortcut: pa Completion Scopes: All   @property (assign, nonatomic) 

Check the code snippet library, and there are also many frequently used quick operations, such as if, ifelse, dowhile, etc.


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.