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

Custom InfoWindow for marker Google Maps SDK, Swift 2.0

I'm trying to implement this (https://www.youtube.com/watch?v=ILiBXYscsyY) Custom InfoWindow tutorial that was done for Objective-C in Swift 2.0. I have tried doing this by just mix-matching Objective-C and Swift code, but I have been unsuccessful…
Ivan
  • 665
  • 2
  • 10
  • 28
3
votes
2 answers

using IBOutlet from another class in swift

I have an IBOutlet in ViewController.swift called backgroundView class ViewController: UIViewController, SideBarDelegate { @IBOutlet weak var backgroundView: UIView! And I want to use that IBOutlet on SideBar.swift @objc protocol…
Songshil
  • 77
  • 9
3
votes
1 answer

IBOutlet variable name surrounded by ( ` )?

I'm not sure why, but for some reason I control-dragged a button as an Outlet to a view controller as usual, but the name was surrounded by Grave Accents ( ` ). Is there a reason for this? I haven't seen this notation before in Swift. What does it…
Cole
  • 2,641
  • 1
  • 16
  • 34
3
votes
2 answers

IBDesignable - IBOutlet is nil in property didSet method

Even though my property is viewable in IB’s property inspector when I select the appropriate view, the property’s didSet method does not update the relevant subview’s. Here is my property: @IBInspectable var imageRepresentation: UIImage = UIImage()…
Adam Carter
  • 4,741
  • 5
  • 42
  • 103
3
votes
2 answers

Interface builder problem: When hooking up an IBOutlet, getting "this class is not key value coding-compliant for the key"

Here is what I do: 1) Create New UIViewController subclass , tick with NIB for interface builder 2) In the header: @interface QuizMainViewController : UIViewController { UILabel* aLabel; } @property (nonatomic, retain) IBOutlet UILabel*…
Robert
  • 37,670
  • 37
  • 171
  • 213
3
votes
1 answer

IBOutlet to two viewControllers on two storyboards... is that possible

I have an app with two targets, for iPhone and for iPad. This project is not using size classes. On the iPhone version I have a storyboard that contains a viewController called “termsAndConditions”. This viewController has class files…
Duck
  • 34,902
  • 47
  • 248
  • 470
3
votes
1 answer

Where is NSTextField?

I'm brand new to Mac OS X development. Primarily a Java and C# developer. I'm reading this book and trying a few examples from the book. In my AppController class, I'm trying to add an IBOutlet as follows : IBOutlet NSTextField *textField; It gives…
AyushISM
  • 381
  • 7
  • 21
3
votes
2 answers

How to get a compiler warning when an IBOutlet is disconnected

How can I have Xcode warn me if an IBOutlet of one of my objects is not hooked up to anything in a NIB? I can check that outlets are connected at runtime by adding assert(ofEveryOutlet); in awakeFromNib or viewDidLoad. But it's not as useful, or…
Vincent Gable
  • 3,455
  • 23
  • 26
3
votes
1 answer

Swift Master-Detail Template App Mystery

I'm getting a Can't unwrap Optional.None error when running a slightly modified version of the Master-Detail App in Swift. All I did was add a second UILabel to the DetailViewController, right under the pre-existing detailDescriptionLabel, and when…
sirab333
  • 3,662
  • 8
  • 41
  • 54
3
votes
2 answers

UIStoryboard Container Attach IBOutlet To Parent ViewController

I wanted to use a UITableView which contained static cells with a UITextField inside attached to my LoginViewController. I have added IBOutlets in the header file that correspond to the UITextFields in the storyboard. Unfortunately Xcode does not…
William George
  • 6,735
  • 3
  • 31
  • 39
3
votes
1 answer

Can't affect UITextView content with initWithCoder

I'm trying to get a string displayed in my UITextView the moment the app is launched. I have a UIView and a UITextView in my interface, and one outlet, myText, which is connected to the UITextView. It doesn't seem to be working and I can't say…
Arthur Skirvin
  • 1,210
  • 1
  • 12
  • 14
3
votes
3 answers

UIViewController created with initWithNibName: bundle: or via an IBOutlet behave differently

I found a strange behavior, and would like to be explained what assertion I am making that is wrong. In an AppDelegate class of a freshly created WindowBased project, I am adding a UIViewController to the window. I can do it two different ways: -…
Guillaume
  • 21,685
  • 6
  • 63
  • 95
3
votes
1 answer

IBOutlet Connections and Inheritance

I'm having two issues with a interstitial class hierarchy I'm writing at the moment. There's a base class for my interstitials: Base class: JSBaseCustomizeableIntersitialView Child class1: JSInviteFriendsCustomizableIntersititialView Child…
dornad
  • 1,274
  • 3
  • 17
  • 36
3
votes
2 answers

Objective-C iOS Development Using viewDidLoad or initWithCoder when setting Variables and Why?

So it seems like I should be setting my member variables in viewDidLoad - but I am confused as to why setting these variables in initWithCoder fails, since both are called at the start of the program. In particular I have a line of code: [worldView…
user3084415
  • 75
  • 2
  • 8
3
votes
2 answers

iOS who is file owner of subview?

I am newbie in iOS development and I have a problem to understand file owner logic. I have this situations: I have two views (View_iPad, View_iPhone) and their controllers (ViewController_iPad, ViewController_iPhone). Based on a device where app is…
DanielH
  • 953
  • 10
  • 30