Iboutlet & Ibaction

Source: Internet
Author: User

Iboutlet UILabel *label;

This label is connected to a Uilabel in Interface builder. At this point, the label's Retaincount is 2.

Therefore, if you use the Iboutlet variable, you must release the variable in Dealloc or Viewdidunload.
Fields or methods modified with Iboutlet and ibaction are related to Interfacebuilder.
Iboutlet modified fields can be associated with the corresponding controls in the Interfacebuilder;
The Ibaction modified method can be associated with the corresponding action of the control in the Interfacebuilder.

Iboutlet is only a token for the compiler, which means that the compiler ignores the keyword.
Interface Builder is based on Iboutlet to find member variables that can be manipulated in the builder.

It is important to note that any member variable that is declared as Iboutlet and connected to a UI component in Interface Builder will be retain for an additional time.

-(ibaction) Button_Click: (ID) sender;

Here sender refers to the current control, so that it is not only a button corresponding to an action, but also can have multiple buttons corresponding to the same action.

Iboutlet is a pointer to a control in the Xib file, and Ibaction is the action of a control in the Xib file.

Use CTRL + Mouse to drag and drop connections

Iboutlet & Ibaction

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.