Questions tagged [iboutlet]

The type qualifier IBOutlet is a tag applied to an instance-variable declaration so that the Interface Builder application can recognize the instance variable as an outlet and synchronize the display and connection of it with Xcode.

An outlet is an object instance variable — that is, an instance variable of an object that references another object. With outlets, the reference is configured and archived through Interface Builder. The connections between the containing object and its outlets are reestablished every time the containing object is unarchived from its nib file. The containing object holds an outlet as an instance variable with the type qualifier of IBOutlet.

Example:

IBOutlet NSArray *keywords;

Because it is an instance variable, an outlet becomes part of an object’s encapsulated data. But an outlet is more than a simple instance variable. The connection between an object and its outlets is archived in a nib file; when the nib file is loaded, each connection is unarchived and reestablished, and is thus always available whenever it becomes necessary to send messages to the other object. The type qualifier IBOutlet is a tag applied to an instance-variable declaration so that the Interface Builder application can recognize the instance variable as an outlet and synchronize the display and connection of it with Xcode.

903 questions
5
votes
3 answers

iOS: IBOutlet nil in Xcode 6

Using iOS 8 and Xcode 6. I embedded a UIWebView in a controller using a storyboard, and hooked everything up. When I run it, though, the webView is coming up nil. Any thoughts?
RyJ
  • 3,995
  • 6
  • 34
  • 54
5
votes
1 answer

weak IBOutlet UIView property would become nil

I have two UIViews in the nib file and I set them to be properties of my view controller, using the IBOutlet and weak keyword. However, when I use self.view1 which I want to use to point to the view in the nib, for the first time, it works. But when…
Gon
  • 1,135
  • 12
  • 22
5
votes
1 answer

Why does Xcode 5 assistant editor defaults to .m file

I realized that when launching assistance editor while working on a XIB file no longer opens the header file by default, instead it shows the implementation file. Is there a new workflow going on I am not aware of? While in the implementation file I…
Mazyod
  • 22,319
  • 10
  • 92
  • 157
5
votes
0 answers

Can someone explain File Owner in iOS

Apologies in advance for this question, though it's been discussed at length since iOS came out. But I still don't get it, despite my best efforts. The closest image I can picture is "frozen and dried object graph", which is fine, but that doesn't…
Alex
  • 1,581
  • 1
  • 11
  • 27
5
votes
0 answers

iOS - Accessing the name of IBOutlet

I am having several IBOutlets of UIView; several subviews within my parent view. I am trying to loop over all the subviews which are UIView. I want to loop over all subviews that have the name of their IBOutlet starting with "view_" Can somebody…
Joe Saad
  • 1,940
  • 3
  • 22
  • 32
5
votes
3 answers

Xcode 4 control-drag won't create first IBOutlet or IBAction if '@end' is a header file's last line

I created an Xcode 4.5.2 project starting with the Single View Application for iPhone template. After adding a UIButton to MainStoryboard.storyboard, I'm able to control-drag from the button to ViewController.h's code to create a new IBOutlet or…
John Sauer
  • 4,411
  • 1
  • 25
  • 33
5
votes
2 answers

Is it possible to check if a UI element has a certain reference outlet?

I'm writing unit tests to find if elements exist on a certain nib. For example, I want to loop through a nibs views and check if one exists with a referencing outlet 'commentTextView', to check if that text view exists. Right now, I only see methods…
Logan Serman
  • 29,447
  • 27
  • 102
  • 141
5
votes
1 answer

iOS - IB view mode

I'm just curious, but what is the IB View Mode even used for? I've changed this many times with no effect? Can someone please explain.
Romes
  • 3,088
  • 5
  • 37
  • 52
4
votes
3 answers

Connecting IBOutlets, variable, property or both?

When using IB in combination with assistant view you control-drag an element in the IB to the .h file and create an outlet. You can drag it to one of 2 place, either inside the variable declaration block or outside the block. If you drag it inside…
DBD
  • 23,075
  • 12
  • 60
  • 84
4
votes
2 answers

How can i create `IBOutlet` or `IBAction` in custom class

how can i create IBOutlet or IBAction taking into account following conditions: IBAction or IBOutlet must be created inside my custom class (inherited from NSObject) NSButton instance is visible inside Interface Builder (XCode 4) In short i would…
xyz
  • 2,277
  • 2
  • 25
  • 41
4
votes
6 answers

Should every IBOutlet have a property?

We create property for a variable for using it in some other view. Same we do for IBOutlets. But not always for using them. Is it necessary to create property for each IBOutlet we just created it our xib? Or is it only a good practice to do so?
Nitish
  • 13,845
  • 28
  • 135
  • 263
4
votes
2 answers

Crashes when use Storyboards and XIBs over Swift package manager

we have a UI Library in Swift that contains our company UI elements for iOS Apps (there are some xibs, some storyboards and some swift code). We have decided to add the support for swift package manager for this lib (before was added with Cocoapods)…
user1458259
  • 139
  • 1
  • 5
4
votes
0 answers

"[plugin] AddInstanceForFactory: No factory registered for id" - nothing to do with Audio

I have an otherwise empty and newly created UIKit project that just has a single UIViewController displaying on launch. It's using the 'Main.Storyboard'. That View Controller has a UITextView which is linked to the code as an IBOutlet. @IBOutlet…
iOSProgrammingIsFun
  • 1,418
  • 1
  • 15
  • 32
4
votes
3 answers

Can't connect IBOutlets for custom UITableViewCell

I've got a problem trying to create a custom tableview cell for my iPhone app in Xcode 4. I've created the .h and .m files, created IBOutlets for all of the subviews that should be present inside the cell, and dragged the actual controls onto the…
blabus
  • 795
  • 2
  • 14
  • 25
4
votes
2 answers

Is there a way to see object names in debug view hierarchy?

The debug view hierarchy is a great way to view they different layers that make up the UI, but as far as I can't tell there is no way to see what outlet reference names the objects have. They are simply referred to as what type of object they are.…
Joakim Sjöstedt
  • 824
  • 2
  • 9
  • 18