(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