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
4
votes
1 answer

instruments: memory leak when creating UIButton

I am trying to find out why when creating an UIButton in interface builder - a memory leak occurs when running the instruments application by xcode. This is how I created the memory leak. I opened a new application, opened up the…
Pavan
  • 17,840
  • 8
  • 59
  • 100
4
votes
2 answers

Can't link to outlet collection in XCode9

I have some constraints that a shuffle around during an animation. After upgrading to XCode9 I tried to make some tweaks, and the editor seems to no longer allow me to add constraints to an constraint collection IBOutlet. I even created a new…
Kevin DiTraglia
  • 25,746
  • 19
  • 92
  • 138
4
votes
1 answer

How to let a UIViewController to inherits another UIViewController IBOutlets?

After Implementing the following (Class Inheritance): class UIViewControllerA: UIViewControllerB { } How to let UIViewControllerA to inherits UIViewControllerB IBOutlets? How can I connect the components at Storyboard to the subclass…
keen
  • 43
  • 1
  • 4
4
votes
1 answer

Trigger an action when cell in static UITableView is tapped [Swift]

I have eight, different static cells in a tableview. I am trying to perform different actions with six of the cells. Two of them open an alert view, two open safari, one clears a cache, and the last one opens a share popover. Previously, they all…
Miles
  • 625
  • 2
  • 9
  • 18
4
votes
2 answers

Array of Outlets of type Label

I have 16 Outlets variables. @IBOutlet var label00: UILabel? @IBOutlet var label01: UILabel? @IBOutlet var label02: UILabel? @IBOutlet var label03: UILabel? @IBOutlet var label10: UILabel? @IBOutlet var label11: UILabel? @IBOutlet var label12:…
hatim
  • 218
  • 4
  • 16
4
votes
3 answers

IBOutlet elements come out nil when I try to set them in viewDidLoad

I am creating a carousel in which there will be 3-4 view controllers. I created a viewcontroller in storyboard and I set the IBOutlets inside viewDidLoad(). My plan is to instantiate these ViewControllers and dynamically change their iboutlets.Since…
bcv
  • 83
  • 1
  • 7
4
votes
1 answer

Objective C & Swift Interoperability causes error "Extensions may not contain stored properties"

I was working on one of my previous app that was done on Objective C. I need to add a new module to it and I decided to use Swift for that particular module. I have a class called HomePage in Objective C, I wanted to add some new IBActions and…
Midhun MP
  • 103,496
  • 31
  • 153
  • 200
4
votes
10 answers

Handle tap on same segmented button?

I'm trying to handle a tap event on a segmented control, but when the selected button is clicked again. For example, for the screenshot below where "Second" is already selected, how do I handle the action when the "Second" button is clicked again? I…
TruMan1
  • 33,665
  • 59
  • 184
  • 335
4
votes
3 answers

All IBOutlets are nil

Hello I am initializing viewController using this code: var aboutUsViewController = self.storyboard?.instantiateViewControllerWithIdentifier("AboutUsViewController") as AboutUsViewController After this I move to aboutViewController. However all my…
Yestay Muratov
  • 1,338
  • 2
  • 15
  • 28
4
votes
1 answer

IBOutlet of another view controller is nil

I have a storyviewcontroller which has objects on its view. I need to change the text on the UILabel(In the storyviewcontroller) and the load the view on an array. I have connected the IBOutlet to the label in the storyviewcontroller. class…
4
votes
2 answers

Change position of a IBOutlet in Swift

So i have this button: @IBOutlet var bouton: UIBarButtonItem! And i want to change is position But the buton doesn't seems to have a position property like for SKSpriteNode So is there a way to change is position ?
Clément Bisaillon
  • 5,037
  • 8
  • 32
  • 53
4
votes
1 answer

Public vs Private IBOutlets

I wonder what is considered to be a better practice in a situation when I need to read the contents of the UILabel / UITextField from another view controller between the following two possibilities: 1) Simply create an IBOutlet to the UITextField in…
user-123
  • 874
  • 1
  • 13
  • 34
4
votes
1 answer

How to do IBOutlets in MonoTouch?

I have done one iPhone app in Objective-C. When I want to link a Label to some data in that I would declare it like this: @interface CityDetailViewController : UIViewController { UILabel *cityName; } @property(nonatomic, retain) IBOutlet UILabel…
James P. Wright
  • 8,991
  • 23
  • 79
  • 142
4
votes
2 answers

Get size of IBOutlet UIImageView

I need to get the size of an IBOutlet UIImageView drawn in Interface Builder. But if I read the IBOutlet UIIMageView.image.size.width or .height in the viewDidLoad, viewWillAppear or viewDidAppear method I always get 0 !!! Where (which method) and…
Stephmt69
  • 41
  • 1
  • 2
4
votes
1 answer

The UITextView's font is nil, but I set it in storyboard

SYBListWeiBoCellView is a custom cell and it has a UITextView. I set the font of the UITextview in storyboard, and make a IBOutlet in SYBListWeiBoCellView called repoText. When I get the SYBListWeiBoCellView through SYBListWeiBoCellView *cell =…
Xiao Ming
  • 131
  • 1
  • 12