Learning iOS Development UI--strong,weak parameter setting and runloop mechanism in @property

Source: Internet
Author: User

[Email protected] The parameter Description

========================================

ARC is a set of memory management mechanisms introduced by Apple to simplify the programmer's memory management

Using the ARC mechanism, the application and release of objects will be automatically added to the code by the compiler at run time retain and release

1 > Strong: An object referenced by a strong pointer that is not released by the system during the life cycle

in OC , objects are strongly pointers by default

2 > Weak: The object referenced by a weak pointer, the system immediately releases

Weak pointers can point to other objects that have already been referenced by a strong pointer

@property Parameter Usage Summary:

1> control with weak

2> Property objects with strong

3> Non-object type with assign

4> string nsstring with copy

Tip: When you implement the interface layout in pure hand code, you need to use the strong strong pointer if you are using lazy loading to handle the interface control.

2. Run the Loop

========================================

In an IOS application, the system creates an interaction that runs the loop listener user after the application is started.

The following code is essentially registering a listener event in the run loop

[Button addTarget: Self action:@selector(click:) forcontrolevents:uicontroleventtouchupinside];

When the run Loop detects the UIControlEventTouchUpInside event of a button , it gives the view controller (self) Send a click message.

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.