0

I am trying to create a simple dictionary that holds String keys and UIImageView as values. I have UIImageView variables declared from the storyboard.

@IBOutlet weak var image0: UIImageView!
@IBOutlet weak var image1: UIImageView!

var buttonImagePair: Dictionary<String,UIImageView> = ["button0":image0!, "button1":image1!]

This code gives me the following error:

'gameViewController.Type' does not have a member named 'image0'

What am I doing wrong?

EDIT: I declared gameViewController as a class. It is called from the main page of the app (when a user clicks a button as a Triggered Segue) to load page 2 of the app.

class gameViewController: UIViewController 
zeeshan
  • 719
  • 2
  • 7
  • 13
  • Exactly how are you utilizing instances of `gameViewController`? – Vatsal Manot Jan 09 '15 at 20:05
  • The problem is that a property cannot be initialized using values of other properties. Here is another question about the same problem with a different solution: http://stackoverflow.com/questions/25854300/change-the-x-and-y-in-a-cgrectmake – Martin R Jan 09 '15 at 20:12

0 Answers0