iOS Development UI Basics-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"2 3 @implementationNsarray (Log)4 5-(NSString *) Descriptionwithlocale: (ID) Locale6 {7 //iterates through all the contents of the array, stitching the contents into a new string to return8nsmutablestring *STRM = [nsmutablestringstring];9 Ten[StrM appendString:@"(\ n"]; One A //iterate through the array, self is the current array - for(IDObjinchSelf ) { - //when stitching a string, the description method of obj is called the[StrM AppendFormat:@"\t%@,\n", obj]; - } -[StrM appendString:@")"]; - returnStrM; + } - + @end