OS Development UI Chapter-ios some tips for using Xcode in development

Source: Internet
Author: User

First, the use of shortcut keys

The following shortcut keys are commonly used:


Shift + CMD + N New Project

CMD + N New file


Option + cmd + ENTER to open assistant editor

CMD + return display main window

cmd + 0 Navigation window

Option + cmd + 0 tool window

Switch between. M & H control + cmd + up/Down

Switch between control + cmd and around in the order of the Browse files

View header file Control + cmd + j

Switch to the corresponding function control + 6 support smart Input, note input method


CMD + R Run

CMD +. Stop it

CMD + b Compilation

CMD + SHIFT + B static memory analysis compilation to check for memory leaks on the program structure


Control + I re-indent the selected button

CMD +] Increase indent to the right

CMD + [Decrease Indent to the left]

CMD +/comment/uncomment, hint: When uncomment is canceled, the comment double slash must be at the beginning of the line

cmd + up to file start position

CMD + down to file end position

Second, OC Proprietary annotations

annotation forms and effects

(1) #pragma mark notes

(2) #pragma mark-notes

Third, the use of warning (note)

form of Use:

#warning code's not finished.

can help us to quickly locate the code

Iv. use of code blocks

For frequently used blocks of code, you can save it as a block of code and set the prompt for fast encoding.

Make appropriate edits to a block of code

Use < #name #> and < #type #> to keep blocks of code from being "written dead";

After setting the prompt effect:

Five, print content view (rewrite description method of skill)

code example:

-(NSString *) description{    //contains the object type name, and the object's pointer address    return [NSString stringwithformat:@ "<%@:%p> {answer:% @, Title:%@, Icon:%@, Options:%@} ", [Self-class], self, self.answer, Self.title, Self.icon, self.options];}


If you want to trace the details of an object at development time, you can override the description method, similar to the Java ToString ()

Add an extension to the root class

1 #import "Nsarray+log.h" 2  3 @implementation nsarray (LOG) 4  5-(NSString *) Descriptionwithlocale: (ID) locale 6 { 7     //Iterates through all the contents of the array, stitching the contents into a new string to return 8     nsmutablestring *strm = [nsmutablestring string]; 9     [StrM appendstring:@ "(\ n"     )];11//traversal array, self is the current array of     (id obj in self) {+         //when stitching strings, The description method that will call obj         [StrM appendformat:@ "\t%@,\n", obj];16     }17     [StrM appendstring:@ ")"];18     return strm;19}20 @end

OS Development UI Chapter-ios some tips for using Xcode in development

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.