خرید بک لینک

Vote count: 0

I need to store data so I have; restaurantName, categories for that restaurant(which would be an array of Strings), an array of Items for each category, and a number for each item in the

open class Item{
var name = String()
var numberOfCarbs = Int()
var category = String()
init(name n:String,numberOfCarbs c:Int,category t:String){
    name = n
    numberOfCarbs = c
    category = t
}

}
open class Restaurant{

var items = [Item]()
var cateogry = [String]()
var restaurantName = String()

init(restaurantName n:String,category c:[String],items i:[Item]){
    restaurantName = n
    cateogry = c
    items = i
}

I dont know how to separate the name of the item and the number. Is this the best way to do this?

asked 30 secs ago

برچسب: نویسنده: استخدام کار تاريخ: جمعه 15 ارديبهشت 1396 ساعت: 22:10

صفحه بندی