I'm working on Stanford's Matchismo game and I'm trying to create an array of buttons that I can reference in the controller. it's a card game, each card a button.
I drag/drop a UIButton to the controller and then set it up in an outlet collection. Not only does it set it up but lets me link multiple outlets to that collection. So far so good.
However when I compile my code (target iOS 7.1) I get a 254 error. I've identified that it's the outlet collection that causes the error.
class MainController: UIViewController{
let cardDeck = PlayingCardDeck()
@IBOutlet var cardButtons: UIButton[]
}
When I replace the UIButton[] mention with NSArray the compiler loads without error. But this is not at all what the exercise is all about - I'm expecting Swift to register the outlets that have been linked to the UIButton[] array and allow me to manipulate that array.
That is, as far as I can tell, the expectation set by the "link to outlet collection" feature in XCode6 Beta 3.
I uploaded a screenshot of the error report. Apparently this has to do with unwrapping the weakly referenced optional array. This is beyond my powers to fix on my own.