swift - "expected expression in container literal" in a while loop XCODE -
i have problem code when try use
import foundation import webkit let beaches: [string: beach] = [ /* mate asher */ var = 25 while <= 30 { = + 1 string! let urlpath = ("http://web.com/a.php?id=" + + "&get=name") let url: nsurl = nsurl(string: urlpath)! let session = nsurlsession.sharedsession() let task = session.datataskwithurl(url, completionhandler: {data, response, error -> void in}) let urlpath2 = ("http://web.com/a.php?id=" + + "&get=area") let url2: nsurl = nsurl(string: urlpath2)! let session2 = nsurlsession.sharedsession() let task2 = session.datataskwithurl(url2, completionhandler: {data2, response, error -> void in}) let urlpath3 = ("web.com/a.php?id=" + + "&get=longi") let url3: nsurl = nsurl(string: urlpath3)! let session3 = nsurlsession.sharedsession() let task3 = session.datataskwithurl(url3, completionhandler: {data3, response, error -> void in}) "a": beach(title: data, desc: data2, latitude: 33.080512, longitude: data3), } ]
i @ var line error "expected expression in container literal" can 1 please !?
you not supposed kind of looping/condition making block of codes while creating array's or dictionary. need execute piece of code outside, create variable , use it.
Comments
Post a Comment