1

I use the following class and dictionary. The problem I have is that I get limited by the length and XCode does not allow me to give more then 180 references for my restaurant:

class RestaurantTableViewController: UITableViewController {
var restaurants:[Restaurant] = [

Restaurant(name: "le", type: "the", location: "Le printemps est de retour", image: "a001.jpg", isVisited: "Spring is back", sound: "1", image2: "1.jpg"),   
Restaurant(name: "de", type: "of", location: "Un verre de vin", image: "a002.jpg", isVisited: "A glass of wine", sound: "2", image2: "2.jpg"),   
Restaurant(name: "un", type: "a", location: "Un ticket de bus", image: "a003.jpg", isVisited: "A bus ticket", sound: "3", image2: "3.jpg") ....
}

My question is: How can I expand my dictionary ? I have a thousand reference that I want to put in a table so people can pick the one they want.

I hope my question make sense otherwise I can clarify.

nicael
  • 18,550
  • 13
  • 57
  • 90
Steph
  • 11
  • 2
  • Can you add the error you get when you're trying to instantiate this array? – Joël Salamin Apr 03 '15 at 08:03
  • 2
    Compare http://stackoverflow.com/questions/25810625/xcode-beta-6-1-and-xcode-6-gm-stuck-indexing-for-weird-reason or http://stackoverflow.com/questions/29360748/swift-app-takes-6-minutes-to-build. The Swift compiler has problems with "large" expressions. You could read the data from a file (e.g. JSON) instead. – Martin R Apr 03 '15 at 08:42
  • 1
    @Joel, I do not have any error but Xcode chunk the data ... when I place 300 or more restaurants references, it trim the data to 186 or something. I was thinking about adding dictionary but did not find the declarations type ... – Steph Apr 03 '15 at 09:10
  • @martin, ok thank you, I'm going to check it out – Steph Apr 03 '15 at 09:11
  • anyone else? Thank you ;) – Steph Apr 03 '15 at 14:12

0 Answers0