ios - Creating an Array of objects from the Facebook SDK in Swift -
im new swift , ios programming in general maybe im google ing wrong things
i have facebook sdk working , returning albums. want data in objects named album. these album objects datasource of collection view cells
when trying run following problem:
i can't objects object array! here code have far:
var = 0 var list: [string] = [] rawfeed : anyobject in data { if rawfeed fbgraphobject { if var jsonfeed = rawfeed as? fbgraphobject { var app = jsonfeed["name"] string list.append(app) var = album(albumname: jsonfeed["name"] string , albumid:jsonfeed["id"] int,count: jsonfeed["count"] int) arrayofalbums.append(test) i++ } }
i thought use value of i
object name.
like this:
arrayofalbums = { [0] => albumobject0, [1] => albumobject1 }
when trying following error on i++
rule: 'album' not identical 'cgfloat'
what doing wrong , can improve code?
you redefining i
variable - think wanted name test
.
note can simplify code here:
if rawfeed fbgraphobject { if var jsonfeed = rawfeed as? fbgraphobject {
as:
if let jsonfeed = rawfeed as? fbgraphobject {
Comments
Post a Comment