Ios development-single-sample macro extraction, ios Development Macro Extraction
In daily development, we often use macros, which are essentially replacing the code during compilation.
Example 1:
// ## Variable names that can be used to splice macros
# Define demo (xxx) int # xxx"
Main (){
Int intA = 10;
Int intB = 20;
NSLog (@ "=======% d", demo (A) + demo (B ));
}
How to Use Singleton ios in development
Method One:
In the BIOS to set up, the specific steps are:
After the computer power, press del key, enter the BIOS setup program, enter the advanced BIOS features, where the boot Num-lock an item, change its value on (or enable), so that the system starts, the keypad number key is valid.
Method Two:
If you want a simpler way to boot, to enter the user name and password when it is not bright, you click NumLock Let it bright, and then do not log on
You said "the keypad on the desktop" should be called the Language bar, and if the icon is lost, it can be recovered in the following ways:
Method 1, click the right mouse button in the blank space of the taskbar → point to Toolbars on the pop-up shortcut menu and click the Language bar in the next menu that appears.
Method 2, click "Start" → "Control Panel →" date, time, language, and locale "→" regional and language Options → popup area and Langua
On the internet to see a lot of digital keyboard, in the input user account, the direct soft keyboard appears digital keyboard, but a lot of code some will be less a word, it is not good to use, the use of their own and correct paste over, see Code
in XML
android:inputtype= "number" Android :d igits= "1234567890" android:id= "@+id/username_edit" android:background= "@mipmap/userbg" android:layout_width= "fill_parent" android:layout_height= "wrap_content" andro
Copy Code code as follows:
function Isnum ()//Judge keypad input number
{
var str= (Window.event.keyCode);
if (str>105 | | str{
if (str!=8)
{
Window.event.returnvalue=false;
Return
}
}
}
function Isnumup ()//To determine the main keyboard input number
{
var str= (Window.event.keyCode);
if (str>57 | | str{
if (str!=8)
{
Window.event.returnvalue=false;
Return
}
}
}
+
Test code:
Copy Code code as follows:
I feel like a macro. To put it bluntly, it is the flag of a global variable. The method it adds is as follows:
[emailprotected]7817:~/PROJECT/PROJECT_V5/32_kk_qhd_k25$ vim mediatek/config/common/ProjectConfig.mk.global
Projectconfig. mk. Global, as shown in the following figure.
####################################################################################################################################################################
A #else the //Compiling without ARC + #endif - //releasing an object $ #defineSafe_delete (P) if (p) {[P release], p = nil;} $ #defineSafe_release (x) [x Release];x=nil - //----------------------Memory-related---------------------------- - the //----------------------Pictures related to---------------------------- - //reading Local picturesWuyi #defineLoadImage (File,ext) [UIImage imagewithcontentsoffile:[[nsbundle mainbundle]pathforresource:file OfType:ext] the //Defining UIImage Objects - #
As shown below we open the EXCEL2007 worksheet and click the Circle in the upper-left corner as shown below
Then we click on "Excel Options" in the Open interface.
Okay, when we open it, we'll hit the "Trust Center" effect as shown below.
Click on the "Trust Center Settings" option to open the entry, the effect shown below
Click the "Macro Settings" option to open the entry details as shown below
Click "Enable
When there is too much code in your code, it is especially inconvenient to read the code, and you need to use a newline character "\". Be aware of two points when using line breaks:
The 1.c compiler is based on ";" To determine if it is a statement, so as long as it's not wrapped in parentheses, it's OK.
2. Do not put the space in the middle.
line wrap problem when string constants are definedIf we place a backslash at the end of a line of code, the C language compiler ignores line breaks at t
lock APIs are:spin_lock_init (x)This macro is used to initialize the spin lock x. Spin locks must be initialized before they are actually used. The macro is used for dynamic initialization.define_spinlock (x)The macro declares a spin lock x and initializes it. The macro is defined for the first time in 2.6.11 and does
One.#define是C语言中提供的宏定义命令, the main purpose is to provide programmers with certain convenience in programming, and to a certain extent, improve the efficiency of the program, but students often do not understand the nature of the command in learning, always create some confusion here, in the programming of the misuse of the command, To make the program run inconsistent with the intended purpose, or to read the program written by others, the results of the operation to understand the error, which
Inline functions are executed in much the same ways as with parametric macro definitions, but the parameters are handled differently. Macro definitions with parameters do not perform an operation on the parameters, but instead directly replace the
The inline function is the function first, which means that many properties of the function are applicable to the inline function, that is, the inline function fi
1 OverviewUsed preprocessing commands starting. For example, include the command # include and macro definition command # define. In the source program, these commands are placed outside the function, and are generally placed before the source file. They are called preprocessing.
Preprocessing refers to the work done before the first scanning (lexical scanning and syntax analysis) of compilation. Preprocessing is an important function of C language, w
Many C + + books have advised us that C-language macros are the root of all evils, but things are not as bad as we think, like Goto. Macros have a big role in automatically generating code for us. If the template can produce various types of code for us (type substitution), then the macro can actually generate new code for us on the symbol (that is, symbol substitution, increment).
Some of the syntax questions about macros can be found on Google. Bel
In the C and C + + languages, an identifier is allowed to represent a string, called a macro, which can be a constant, an expression, a format string, and so on. When compiling preprocessing, all occurrences of the "macro name" in the program are substituted with the string in the macro definition, which is called "macro
(i) Symbolic constants
A macro definition is a substitution policy in C that uses a preprocessing command #define equate a string of (verbose) text with a name (called a macro), and then you can use the macro in bulk in the source code. In the preprocessing phase, replace the macros in the source code with the original text. For example, in the source code:
#def
1. How do I differentiate between macro names and macro strings in a macro definition? What should I pay attention to for macros with parameters?
In a macro definition, the macro name and macro string are distinguished by spaces.
There are many places in the C language where macro definitions are used, such as in header files to prevent header files from being repeatedly included:
#ifndef ctest_header_h
#define CTEST_HEADER_H
/header file content
#endif
Many macro definitions are also available in our common stdio.h header files, such as:
#define BUFSIZ 1024//Buffer size
#define EOF ( -1)// table file at the end
#ifndef seek_set
C/C ++ macro usage Summary
Macro replacement is the Technical Feature of the C/C ++ series languages. The C/C ++ language provides powerful macro replacement functions. Before the Source Code enters the compiler, first, a module called "Preprocessor" is used to expand the macro Based on the Compilation parameters and a
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.