vendredi 9 janvier 2015

Unable to get Array Value in SWIFT

I retrieved values from parse and stored one by one in an array called "sto_tit". But if I try to print the values, I unable to print. It is get printed inside loop only, but not get printed Outside FOR LOOP or OUTSIDE ELSE block, I don't know what error in my code. Kindly guide me!


MY CODE BELOW:



func A{

if() {}

else {

for i in 0...self.results.count {
self.par_object = self.results.objectAtIndex(i) as PFObject
var sto = self.par_object["story_title"] as String
self.sto_tit.append(sto)
println("Check_1 (self.sto_tit)") //Printing All Values, but one by one.
//i.e, [A], [AB], [ABC], [ABCD], ...

}//FOR ENDS

println("Check_2 (self.sto_tit)") //LINE GETS SKIPPED
} // ELSE BLOCK ENDS
println("Check_3 (self.sto_tit)") // "[]" SIMPLY PRINTING LIKE THIS
} // FUNC ENDS

Aucun commentaire:

Enregistrer un commentaire