objective-c array is only saving one object in it -


this have

for (pfobject *object in objects){     nsstring *address = object[@"address"];     addarray = [nsmutablearray arraywithobjects:address, nil]; }  nslog(@"outside loop");  for(nsstring *add in addarray) {     nslog(@"%@", add); } 

the address string ends printing out amount of addresses inside loop if use nslog(@"%@", address); know address string changing next one. reason array shows last address , won't save first one.

    addarray = [nsmutablearray array];     (pfobject *object in objects)     {         nsstring *address = object[@"address"];         [addarray addobject:address];     } 

Comments

Popular posts from this blog

python - pip install -U PySide error -

arrays - C++ error: a brace-enclosed initializer is not allowed here before ‘{’ token -

cytoscape.js - How to add nodes to Dagre layout with Cytoscape -