Deleting an Outlet

吴高洁
2023-12-01

Deleting an outlet coherently — that is, without causing one of the problems described in the previous section — involves working in several places at once,


  1. Disconnect the outlet in the nib.
  2. Remove the outlet declaration from the code.
  3. Attempt compilation and let the compiler catch any remaining issues for you.


a. 

Disconnect the outlet in the nib. To do so, edit the storyboard, select the source object (the view controller), and disconnect the button outlet in the Connections inspector by clicking the X

b. 

Remove the outlet declaration from the code. To do so, edit ViewController.h and delete or comment out the @property declaration line.

c.

Remove other references to the property. The easiest way is to attempt to build the project; 


 类似资料:

相关阅读

相关文章

相关问答