Iphone Development notes

Source: Internet
Author: User
Tags variable scope

1. The iphone development environment is best performed on mac OS, but mac OS is built on Free BSD + OpenStep. * It is easy to build a development environment on inux, however, XCode development without mac OS is more difficult.

2. The development language used by the iphone is Obective-C, which is almost fully compatible with the C syntax (not C ++ ).

3. Although the root class can be defined at will, NSObject is generally used as the root class.

4. Added ObjectC content:

@ Interface... @ end class definition,

@ Implementation... @ end class implementation,

@ Class predeclaration,

@ Property and @ synthesize synthesis Declaration (similar to setter and getter ),

[] Class call. objectC is called message sending. The first position is the message receiving object.

# Import instead # include

Self object itself

Super parent class

5. How to instantiate an object [[NSAID utoreleasepool alloc] init];

It consists of two steps: One alloc request memory, init initialization object.

It can be replaced by [NSAID utoreleasepool new], but it is not recommended.

[** Drain]

6. ObjectC only uses pointers to represent an object.

7. The id data type can be considered as an Object similar to the. NET encapsulation operation. The Compiler determines the conversion from everything to other types. Id is a common pointer type.

8. Use @ try, @ catch, @ finally, and @ throw to handle exceptions.

9. variable scope control @ public, @ private, @ protected, @ package

10. Adding @ to the string is a constant string object.

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.