Questions tagged [iboutletcollection]

The type qualifier IBOutletCollection 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. It works in a similar way to IBOutlet except it allows a collection of objects

101 questions
3
votes
0 answers

IBOutletCollection is not ordered, when it's within a UIViewController, which is instantiated from a Storyboard

I often use IBOutletCollection to be able to reference UIView objects sequentially. For example, I can enumerate ordered list of UIButtons, get numerical indice of them, without making same number of IBOutlet for each of them. It's very useful,…
petershine
  • 3,190
  • 1
  • 25
  • 49
2
votes
1 answer

not key value coding-compliant in Swift class that extends ObjC subclass with @IBOutletCollection

I have a large app with LOTS of ObjC classes that we've written over the years. I'm trying to migrate over to Swift a bit at a time because I can't risk a mass shift that could break too many things. This is my class hierarchy for my current…
Kenny Wyland
  • 20,844
  • 26
  • 117
  • 229
2
votes
2 answers

Apply and animate many constraints to outlet collection of uiviews

I have an outlet collection of labels. The labels are in stack views parented by a stack view. When the view loads I'd like to have each label fade in and move slightly to the right one after the other. I can apply the constraint in a loop to offset…
2
votes
1 answer

Register form with outlet collection and tags

I am new to Swift Language. I have knowledge in Web Development, but I need your help regarding this. I need to create a register page with outlet collection. I have 4 text fields and have assigned tags to each of them. As I am going towards moving…
Rob
  • 2,086
  • 18
  • 25
2
votes
2 answers

Use a pickerView on a outlet collection textfield

My code bellow is a uitextfiled that uses a picker view to display a and b. All I want to do is have the is have the same picker view appear for all of the textfields using outlet collection. Textfield is the single textField and mutlipleTextifeld…
user8105388
2
votes
1 answer

Create an outlet collection in Xcode 8

I'm building a macOS app using Xcode 8.3 and Swift. I have a simple view controller that contains a bunch of buttons that I'd like to put into an Outlet Collection but when I control-drag from a button to my Swift file, Outlet Collection is not…
RobertJoseph
  • 7,968
  • 12
  • 68
  • 113
2
votes
1 answer

Assigning Buttons Inside An Outlet Collection Different Values (Swift 3 Xcode 8)

I am creating a quiz game and my quiz view controller has a label at the top with a question and then there are 4 buttons with text inside of them (1 of the 4 buttons contains the correct answer). I want to make it so that the buttons are in an…
jj_hennessy
  • 55
  • 1
  • 6
2
votes
1 answer

Renaming class causes IBOutlet connection to fail

I renamed a class, which happened to have an outlet connection to a label called mainLabel in a storyboard file. When I run my program, it crashes and gives me the error: "this class is not key value coding-compliant for the key mainLabel". Other SO…
Lahav
  • 781
  • 10
  • 22
2
votes
1 answer

IBOutletCollection not connected with UILabels in Storyboard

I have an IBoutletCollection property connected to several UILabels in Storyboard: @property (weak, nonatomic) IBOutletCollection(UILabel) NSArray *labels; called NSLog(@"%ld",(long)self.labels.count) after viewDidLoad got 0 as result. what's the…
bluenowhere
  • 2,683
  • 5
  • 24
  • 37
2
votes
2 answers

Swift Button Array

In a Swift + SQLite project I'm trying to populate an array of 4 buttons in my UI with a SQL query. The best I could do so far is as the code below shows, but I'm sure it can be done in a cleaner way. I tried to do both the SQL query result reading…
Belerofonte
  • 45
  • 2
  • 4
2
votes
1 answer

IBOutletCollection in Xcode 5.1

I want to create an IBOutletCollection for a list of controls in my application. So in my Document.h I have defined the following outlet: @property (strong) IBOutletCollection(NSControl) NSArray *myControls; In earlier versions the Outlet…
Besi
  • 22,579
  • 24
  • 131
  • 223
2
votes
1 answer

Apply Referencing Outlet to Multiple Buttons (Collection)

I'm trying to set 10 buttons with the same font and style but don't want to create 10 IBOutlets. I've never used a collection before but I believe that is how I minimise code when working with outlets? How can I put this code into a referencing…
BrownEye
  • 979
  • 2
  • 12
  • 21
2
votes
1 answer

IBOutletCollection - how is ordering applied to the array?

Here's a really simple question, that I don't have time to check. . (code working, but looks messy, I'll refactor after getting myself informed). Question: For an IBOutletCollection what is the order? Is it the order in which the connections were…
Jasper Blues
  • 28,258
  • 22
  • 102
  • 185
2
votes
1 answer

Setting layer properties for IBOutletCollection

I'm trying to set the layer properties of multiple buttons connected to an IBOutletCollection but the IBOutletCollection doesn't let me access UIButton.layer the same as it does for a regular IBOutlet. Interface file: @property (strong, nonatomic)…
Old Name
  • 273
  • 1
  • 3
  • 13
2
votes
1 answer

iOS and mutable IBOutletCollections

I have the property: @property(nonatomic, strong) IBOutletCollection(UIView) NSMutableArray *allOpposition; which is wired up in IB to a bunch of subviews and synthesized. Later I have: - (void)willRemoveSubview:(UIView *)subview { [[self…
Ken
  • 30,811
  • 34
  • 116
  • 155