iOS Foundation-xcode warm Tips

Source: Internet
Author: User

(one) code size pragma mark

1. Definition

The code at the beginning of the #pragma is a compiler directive, which is a program-or compiler-specific instruction.

Does not necessarily apply to other compilers or other environments. Assume that the compiler does not recognize the directive. It will be ignored.

1. Use
At the top of the Editor pane, separate the code from the methods and functions pop-up menus. Normalize the code, easy to read and find.


3. Use

Add #pragma mark to the place where you need to stare

#pragma mark-When the view is going to be displayed-(void) Viewwillappear: (BOOL) animated{    //Initialize array of selected numbers/    * Empty the selected betting ball group each time it is switched to Rootview     */    Datamodel *datamodel = [Datamodel sharedatasource];    Datamodel. Balls = [[Nsmutablearray alloc] init];}


(ii) Re-usable tool code Snippets

1. Definition

Will often be collected using code specifications. Shortcut key output when needed

2. Role

Create reusable blocks of code that can be used at high speeds, save on the required operations and time, and create and augment your own code snippet library.

3. Use

Let's create the pragma mark quick action that we just introduced

Create a new project. Enter #pragma mark–< #Title in any place in the project #>

Select all the text, and then press and hold the mouse over the arrow. Drag into Code Snippet Library


Create success, pull to the bottom of code snippet library, change name and add shortcut action

watermark/2/text/ahr0cdovl2jsb2cuy3nkbi5uzxqvd2fuz3blawzlbmc2njk=/font/5a6l5l2t/fontsize/400/fill/i0jbqkfcma== /dissolve/70/gravity/center ">

At this point, the creation succeeds. We randomly enter PM in the class, which will pop up the quick input prompt


Press ENTER to complete your own initiative

Plus, I've built more than three quick-action sets.

Title:nslog Completion Shortcut:log Completion scopes:function or Method   NSLog (@ "< #Log #>");

Title:property Strong completion Shortcut:ps completion Scopes:all   

Title:property Assign Completion SHORTCUT:PA completion Scopes:all   

Check out the code snippet library and there are many quick and easy operations that are often used. such as If,ifelse,dowhile, etc.


Copyright notice: This article blog original articles, blogs, without consent, may not be reproduced.

iOS Foundation-xcode tips

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.