- only
View Controller has Storyboard ID
- other view (eg:
UIButton) no Storyboard ID
how get id of a normal view (in Storyboard) ?
two method:
use Referencing Outlet = normally is weak reference ~= like pointer in C
eg: add reference for UIButton
in Storyboard -> choose your UIButton -> Right Click UIButton -> Referencing Outlets->New Referencing Outlet -> drag it to ViewController.h -> got notice Insert Outlet -> popup window -> set Name to you want, eg deviceNameBtn -> Connect -> auto generated code into ViewController.h
![enter image description here]()
![enter image description here]()
![enter image description here]()
@property (weak, nonatomic) IBOutlet UIButton *deviceNameBtn;
then in you (Objective-C) code, you can use deviceNameBtn as the ID of UIButton, do whatever you want
use (int type) tag
eg: your UILabel view's tag = 1
![uilabel_tag_1]()
get your view:
UILabel *label = (UILabel *)[self.view viewWithTag:1];