ios - Fast enumeration situation -


i'm working fast enumeration variables, seems simple can't make work.

i have code, work

for (nsdictionary *story in stories){      nslog(@"%@", [story objectforkey:@"title"]);  } 

this prints every single key stored in tittle. now, try this

for (nsdictionary *story in stories){      nslog(@"%@", [story objectforkey:@"title"]);      nsstring *titles = [story objectforkey:@"title"];      [self.bigtext settext:titles]; } 

and print one. why?

nevermind, figured out myself.

nsmutablestring *string = [[nsmutablestring alloc] init];   (nsdictionary *story in stories){      nslog(@"%@", [story objectforkey:@"title"]);      [string appendstring:[nsstring stringwithformat:@"%@", [story objectforkey:@"title"]]]; }  self.bigtext.text = string; 

Comments

Popular posts from this blog

html - Sizing a high-res image (~8MB) to display entirely in a small div (circular, diameter 100px) -

java - IntelliJ - No such instance method -

identifier - Is it possible for an html5 document to have two ids? -