Reputation: 1248
I'm trying to find the "Storyboard ID" which should be before Restoration ID in Identity inspector, but I can't find that for any view I've selected. I've tried to open a new project and I still can't find it either.
I'm using Xcode 5.0.2 developing for iOS-7.
Can you tell me what I'm missing here?
Upvotes: 8
Views: 4701
Reputation: 14328
View Controller
has Storyboard ID
UIButton
) no Storyboard ID
id
of a normal view (in Storyboard) ?two method:
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
@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
int
type) tag
eg: your UILabel
view's tag = 1
get your view:
UILabel *label = (UILabel *)[self.view viewWithTag:1];
Upvotes: 1
Reputation: 1576
The storyboard ID is a string field that you can use to create new UIViewController
(not UIButton
or other elements). An example of how to use it can be found here.
Upvotes: 1
Reputation: 19303
You are pointing to a UIView
or some other object on the StoryBoard. Press the yellow indicator on top of the other objects which is your ViewController
Upvotes: 12