iOS Development UI Chapter-ios some tips for using Xcode in development
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
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:%@}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
1#import"Nsarray+log.h"23@implementationNsarray (Log)45-(NSString *) Descriptionwithlocale: (Id) locale6{7//Iterates through all the contents of the array, stitching the contents into a new string to return8 nsmutablestring *STRM = [nsmutablestringString];9Ten [StrM appendString:@"(\ n"];1112//Iterate through the array, self is the current array13for (ID objInchSelf) {14 // when stitching strings, The description method of obj is called 15 [StrM appendformat:\t%@,\n " Obj];}17 [StrM appendString: @ ") " ]; 18 return Strm;19 }20 21 @end
Text top-top iOS Development UI Chapter-ios some tips for using Xcode in development