iOS face question Finishing

Source: Internet
Author: User

(1). What is the difference between weak and assign?

Assign: for non-pointer variables

(2). What is the difference between iOS development----#import, #include和 @class?

1. If it is not C + +, try to use #import.

2. Can be #import in the implementation file, it is not #import in the header file.

3. Can be #import in the @class+ implementation file in the header file, it is not #import in the header file.

(3). What is the difference between category object-c and extension?

Category:

1. To add a new method to class and its subclass

2. Have their own separate. h and. m files

3. To add a new method, but not to add a new property

Extension is often referred to as an anonymous category.

1. Used to add a new method to a class, but only for the original class, not for subclass

2. Only classes with implementation source code can write extension, and for classes without implementation source code, such as the framework class, it is not possible

3.Extension can add new methods to the original class, as well as new properties

(4). Block reference loop problem (ARC & Non-arc)

__weak __typeof (self) weakself = self;

__strong __typeof (weakself) strongself = weakself;

(5) The complete process of program initiation?

1.main function

2.UIApplicationMain

* Create UIApplication objects

* Create a UIApplication delegate object

3.delegate object starts processing (listening) system events (no storyboard)

* When the program is started, the agent's application:didfinishlaunchingwithoptions is called: method

* Create UIWindow in application:didfinishlaunchingwithoptions:

* Create and set UIWindow Rootviewcontroller

* Display window

3. According to Info.plist to obtain the most important storyboard file name, load the main storyboard (with storyboard)

* Create UIWindow

* Create and set UIWindow Rootviewcontroller

* Display window

iOS face question Finishing

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.