2

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 made? Or are tags required if order is important?

Jasper Blues
  • 28,258
  • 22
  • 102
  • 185
  • I don't have an answer, but I'd argue that you probably shouldn't use `IBOutletCollection` if order is important. – nhgrif Dec 12 '13 at 00:11

1 Answers1

1

You cannot use IBOutletCollection safely without adding an additional property like the tag if the ordering is important.

Sometimes they will retain the order in where the connections were added but sometimes they wont.

There are other similar questions that talk about this:

IBOutletCollection set ordering in Interface Builder

Community
  • 1
  • 1
Pochi
  • 13,391
  • 3
  • 64
  • 104
  • I found this to be the case. I thought since it was an array, not a set, it would preserve the order in which you made the connections. For my first couple of uses of an outlet collection, it did. Then, next time I built an app relying on the ordering, it failed miserably. :( – Duncan C Dec 12 '13 at 00:51
  • @Chiquis Duplicate? Oops, I guess I better just delete my question then.. . I can only do so if the answer is also deleted though. . Thanks so much for your help. – Jasper Blues Dec 12 '13 at 01:29