Simple use of iOS development--xcode

Source: Internet
Author: User

Simple use of Xcode

First, the use of shortcut keys

The following shortcut keys are commonly used:

New

Shift + CMD + N New Project

CMD + N New file

View

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

Run

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

Typesetting

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

2, F6 single-step debugging, F7 jump, F8 continue, and Eclipse,vs similar

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 and allow saved blocks of code not to be "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];}

Tips:

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

#import "Nsarray+log.h"

@implementation Nsarray (Log)

-(NSString *) Descriptionwithlocale: (ID) locale
{

Iterates through all the contents of the array, stitching the contents into a new string to return
nsmutablestring *STRM = [nsmutablestring string];

[StrM appendstring:@ "(\ n"];

Iterate through the array, self is the current array
for (id obj in self) {
When stitching a string, the description method of obj is called
[StrM appendformat:@ "\t%@,\n", obj];
}
[StrM appendstring:@ "];
return StrM;
}

@end

The last small summary of some shortcut keys, in fact, as long as you look at the actual operation after more than a few times, then do not rote, if you see here, and you can use these shortcuts in peacetime development, even if it is occasionally used, you can look more than the average developer! (The color section is often used for small series)

1. File

cmd + N: New file
cmd + SHIFT + N: New Item
CMD + O: Open
cmd + S: Save
CMD + SHIFT + S: Saved
cmd + W: Close window
CMD + SHIFT + W: Close file

2. Edit

cmd + [: Left indent
cmd +]: Right indent

cmd + CTRL + Left: Collapse
cmd + ctrl + Right: Collapse
cmd + ctrl + TOP: Collapse All functions
CMD + CTRL + BOTTOM: Cancel all functions collapsed
CTRL + U: Cancel All Section collapse

cmd + D: Add bookmark
cmd +/: Comment or uncomment

CTRL +.: Parameter hint
ESC: auto Prompt list

3. Debug

CM D + \: Set or Cancel breakpoint
cmd + opt + \: Allow or disable current breakpoint
cmd + opt + B: View all Breakpoints

cmd + RETURN: Compile and run (depending on settings to enable breakpoints)
CMD + R: Translate and run (do not trigger breakpoints)
Cmd + Y: Compile and debug (trigger breakpoint)
CMD + SHIFT + RETURN: Terminate run or debug

cmd + B: Compile
cmd + SHIFT + K: Cleanup

4. Form

cmd + SHIFT + B: Compile window
CMD + SHIFT + Y: Debug code window
CMD + SHIFT + R: Debug console
cmd + SHIFT + E: main edit window Adjustment br>
5. Help

cmd + OPT +?: Development manual
cmd + CTRL +?: Quick Help


Command + Shift + E: Extended Editor
Command + [: Move code block left
Command +]: Move code block right
Tab: Accept Code hints
ESC: Show Code hints menu
Ctrl +. (period): Loop through code hints
Shift + Ctrl +. (period): Reverse looping through code hints
Ctrl +/: Move to the next placeholder in the code hint
Command + Ctrl + S: Create snapshot
Ctrl + F: Move forward cursor
Ctrl + B: Move the cursor back
Ctrl + P: Move the cursor to the previous line
Ctrl + N: Move the cursor to the next line
Ctrl + A: Move the cursor to the beginning of the bank
Ctrl + E: Move the cursor to the end of our line
Ctrl + T: Swap the characters on the left and right side of the cursor
Ctrl + D: Remove the character to the right of the cursor
Ctrl + K: Delete Bank
Ctrl + L: Places the insertion point in the middle of the window
Command + Alt + D: Show open quickly window
Command + ALT + UP ARROW key: Open the companion file
Command + D: Add Bookmark
Option + Double-click: Search in document
Command + Y: Run the program in debug mode
Command + Alt + P: Continue (in debugging)
Command + Alt + 0: Skip
Command + Alt + I: Jump in
Command + Alt + T: Jump out

Simple use of iOS development--xcode

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.