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
281
votes
19 answers

Could not insert new outlet connection: Could not find any information for the class named

I got an error on Xcode saying that there was no information about the view controller. Could not insert new outlet connection: Could not find any information for the class named Why is this happening?
Ege Kaan Gürkan
  • 2,923
  • 2
  • 13
  • 24
170
votes
41 answers

"Could not find any information for class named ViewController"

This bug has been driving me nuts since I started using Xcode (4.6.3). Whenever I try to link a Storyboard item to my code, I get the error: Could not find any information for class named ViewController. This happens with custom classes as well.…
user2597451
  • 1,903
  • 2
  • 12
  • 10
167
votes
11 answers

IBOutlet and IBAction

What is the purpose of using IBOutlets and IBActions in Xcode and Interface Builder? Does it make any difference if I don't use IBOutlets and IBActions? Swift: @IBOutlet weak var textField: UITextField! @IBAction func buttonPressed(_ sender: Any)…
suse
  • 10,503
  • 23
  • 79
  • 113
125
votes
32 answers

IBOutlet is nil, but it is connected in storyboard, Swift

Using Swift 1.1 and Xcode 6.2. I have a UIStoryboard containing a singular, custom UIViewController subclass. On it, I have an @IBOutlet connection of type UIView from that controller to a UIView subclass on the storyboard. I also have similar…
Stefan Arambasich
  • 2,231
  • 2
  • 19
  • 24
115
votes
8 answers

How to set the UITableView Section title programmatically (iPhone/iPad)?

I've created a UITableView in Interface Builder using storyboards. The UITableView is setup with static cells and a number of different sections. The issue I'm having is that I'm trying to setup my app in several different languages. To do this I…
user843337
57
votes
7 answers

Swift - IBOutletCollection equivalent

I'm trying to replicate the Stanford Matchismo game from "Developing ios7 apps for iphone and ipad" in iTunesU in Swift. On page 77 of the 3rd lecture slides, it shows using an IBOutletCollection which isn't an option on Swift. The Swift doc…
Alcanzar
  • 16,985
  • 6
  • 42
  • 59
54
votes
8 answers

UISegmentedControl deselect (make none of the segments selected)

in fact the title contains my question. I have a UISegmentedControl, and need to deselect currently selected tab. I tried: [menu setSelectedSegmentIndex:-1]; menu being the UBOutlet for uisegmentedcontrol but this gives me exception. anyone have…
dusker
  • 846
  • 2
  • 8
  • 13
50
votes
3 answers

Why weak IBOutlet NSLayoutConstraint turns to nil when I make it inactive?

I have an IBOutlet NSLayoutConstraint in my app. Very simple: @property (nonatomic, weak) IBOutlet NSLayoutConstraint* leftConstraint; At some point I want to deactivate this constraint: self.leftConstraint.active = NO; It happens in a method…
Andrey Chernukha
  • 21,488
  • 17
  • 97
  • 161
50
votes
3 answers

Xcode Interface Builder - "correct" way to delete/rename miswired IBOutlets / IBActions?

I am new to Xcode, working through Swift, so I'm not sure if what I am decribing is actually a bug. When using interface builder and the assistant editor, I can create lables, buttons etc, and create Outlets and Action in the code with a…
dave_the_dev
  • 1,555
  • 3
  • 15
  • 27
46
votes
10 answers

IBOutletCollection set ordering in Interface Builder

I am using IBOutletCollections to group several Instances of similar UI Elements. In particular I group a number of UIButtons (which are similar to buzzers in a quiz game) and a group of UILabels (which display the score). I want to make sure that…
gebirgsbärbel
  • 2,327
  • 1
  • 22
  • 38
43
votes
7 answers

Strange error when adding items to prototype cells in storyboard-IB

I have quite a large project (~20 scenes). One of which is a TableViewController with a custom UITableViewController class. I have given the cell a reuse identifier, and added a label to it. When I try and Ctrl+Drag the label to the…
Alex
  • 3,031
  • 6
  • 34
  • 56
41
votes
17 answers

Make a UIBarButtonItem disappear using swift IOS

I have an IBOutlet that I have linked to from the storyboard @IBOutlet var creeLigueBouton: UIBarButtonItem! and I want to make it disappear if a condition is true if(condition == true) { // Make it disappear }
38
votes
3 answers

Connect outlet of a Cell Prototype in a storyboard

I'm a newbie with the Storyboard and so I have some difficulties... I have created a TableViewController and I would like to customize the Cell Prototype. In the Cell Prototype I have added several Labels I would like to customize with my own class…
sebastien
  • 2,489
  • 5
  • 26
  • 47
37
votes
5 answers

Swift put multiple IBOutlets in an Array

I made these (marked with red border) IBOutlets using ctrl + drag But i don't like to have the exact same line 9 times (DRY) How do i put these IBOutlets in an Array?
cor
  • 617
  • 2
  • 6
  • 11
36
votes
5 answers

IBOutlet and viewDidUnload under ARC

There is a similar question to this on SO here, however I just want to clarify something that wasn't fully explained there. I understand that all delegates and outlets - in fact any reference to a "parent" object, to be a good citizen and think…
Stuart
  • 36,683
  • 19
  • 101
  • 139
1
2 3
60 61