Objective-C: odd tricks -- use Chinese to write Objective-C; -- use Chinese objective-c

Source: Internet
Author: User

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

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.