Objective-C: odd tricks -- use Chinese to write Objective-C; -- use Chinese objective-c
Technical lust refers to technologies and products that are too clever and useless.
Reprinted please indicate the source http://blog.csdn.net/uxyheaven/article/details/46391771
We can use macros to define basic operators and types.
# Define plus + # define minus-# define multiplication * # define Division/# define greater than> # define less than <# define comparison ==# define equals to = typedef NSInteger; typedef NSString string type;
And write it like this.
Integer number equals (1 plus 2 multiplied by 3 minus 1) Except 2; print (@ "% ld", number );
If we are defining some basic control statements
# Pragma mark-# define loop for # define if # define then # define otherwise else # define otherwise if else if
Then you can use Chinese to make some conditional statements and loop statements.
Integer number is equal to 1; if (Number comparison 1) Then {print (@ "1");} Otherwise (Number comparison 2) {print (@ "2 ");} otherwise {print (@ "3");} loop (integer number equals 0; number less than 5; number ++) {print (@ "% ld", (long) number );}
However, there is an egg.
The above code can be downloaded here
Github