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
15
votes
3 answers

Hide Outlets from Connections Inspector for Custom View

I have created a custom view (Quantity View) with nib file in Swift. I have created some IBOutlets & IBActions (for buttons, labels etc.) in my custom view. I tried to use this custom view (Quantity View) by assigning class name to a UIView in my…
Bhavin
  • 27,155
  • 11
  • 55
  • 94
14
votes
2 answers

How to connect delegate from custom class in xib?

I have created a class "DeletableImageView" (.swift + .xib) which uses the protocol I defined as "DeletableImageViewDelegate" through a property I called delegate. Example for sake of clarity: DeletableImageView.swift protocol…
Matthieu luci
  • 141
  • 1
  • 4
14
votes
4 answers

Xcode 4 - Connecting Outlets

This page shows how easily I can connect outlets http://developer.apple.com/technologies/tools/whats-new.html in Xcode 4, but I can't get it. I right click and drag an outlet from the new referencing outlet circle, and into my header where the…
Bryan
  • 17,201
  • 24
  • 97
  • 123
14
votes
4 answers

How to link ibOutlet from subview to custom UIView Class in storyboard xcode

I think this image explains it all. I have a subclass of UIView that I've entered into the class field. I'm trying to connect ibOutlets between the storyboard and class implementation. It's not giving me an error, but it's not working either. Is…
nwales
  • 3,521
  • 2
  • 25
  • 47
14
votes
3 answers

When should I use Strong vs Weak for IBOutlets (further clarification)

I thought I understood it clearly from this question --> Should IBOutlets be strong or weak under ARC? but I recently had a discussion which left me totally confused. Can someone just confirm if the following is correct? (if this is a duplicate I…
Just a coder
  • 15,480
  • 16
  • 85
  • 138
13
votes
6 answers

Swift - Unit testing functions that involve IBOutlets?

I am setting up unit testing for my Swift project and am having trouble testing a class function that involves updating IBOutlets. I have a function, validateUrl, which expects a string to be passed, then validates it. If it is valid, it enables a…
JimmyJammed
  • 9,598
  • 19
  • 79
  • 146
13
votes
2 answers

this class is not key value coding-compliant for the key imageView

I have a problem with the RootViewController of my application. When I run the app I get this error. What do it means? NSUnknownKeyException', reason: '[ setValue:forUndefinedKey:]: this class is not key value…
Ortensia C.
  • 4,666
  • 11
  • 43
  • 70
12
votes
7 answers

Issues using UITapGestureRecognizers in Interface Builder

I'm attempting to use the UITapGestureRecognizer object that can be found in Interface Builder. I've dragged a single "UITapGestureRecognizer" from the object library to a single view xib. I then create an IBAction method from this tap gesture,…
12
votes
3 answers

Declaring IBOutlet inside or outside @interface?

sorry If am I being too picky on this one but I am learning iOS programming now and I've seem some people who declare the IBOutlet like this: IBOutlet attached to property #import #import "CustomCell.h" @interface…
zanona
  • 12,345
  • 25
  • 86
  • 141
12
votes
2 answers

Override IBOutlet properties from super class?

I would like to create a super class in a framework that modifies IBOutlet properties. However, I would like a subclass to be connected to the storyboard, since I don't want to connect the controls to the class in the framework. For example, the…
TruMan1
  • 33,665
  • 59
  • 184
  • 335
12
votes
1 answer

IBOutlets are nil on iOS 8 devices, but work fine on iOS 9 (Swift)

When running iOS 8, the IBOutlets of my nib based view controllers are nil, but when running iOS 9, they work fine. Any ideas why this might be happening? My app supports iOS 8+, and I'm running Xcode 7.2.
jjramos
  • 1,874
  • 14
  • 22
12
votes
3 answers

Unable to Set Referencing Outlet

I am unable to set a referencing outlet for a text field I have created. I am trying to do this via Ctrl-Drag. Can anyone advise? I have set the delegate as the View Controller. In general, I only have one view which is populated with a few text…
vfvfvfvfvfvfvfvfv
  • 143
  • 1
  • 1
  • 7
12
votes
3 answers

IBOutlets in Swift are nil

(Developing on OSX 10.9, Xcode 6.1b) If I declare IBOutlets in my AppController, everything is fine. I instantiate an object in InterfaceBuilder, drag it across to form an outlet, and by the time I have reached applicationDidFinishLaunching, my…
green_knight
  • 1,319
  • 14
  • 26
12
votes
4 answers

Why some Outlets are made strong references even tough the documentation specifies that outlets should be weak reference

Hi I am a newbie to iOS programming. I know what a strong and weak reference is. But I get confused which type of reference to use when I have to deal with outlets. After going through the documentation which states that Outlets should generally…
iamyogish
  • 2,372
  • 2
  • 23
  • 40
11
votes
2 answers

iOS is there a way to assign Localized String to a UILable from IB/storyboard

I want to assign NSLocalizedString(key, comment) to a UILabel from storyboard without creating an outlet for it.
Nagesh
  • 167
  • 1
  • 2
  • 11
1 2
3
60 61