iphone - iOS NSMutabledictionary is null when I setValue and forKey -


i know may been doing stupid can not figure out error on code:

nsstring *string=@"some string"; [self.dataresponse setvalue:string forkey:@"code"]; 

also tried:

nsstring *string=@"some string"; [self.dataresponse setobject:string forkey:@"code"]; 

but in both cases nsmutable dictionary self.dataresponse null. of knows i'm doing wrong?

i appreciate help.

you need alloc , init nsmutablearray set values in it. example:

self.dataresponse = [[nsmutablearray alloc] init]; // alloc , init  nsstring *string = @"some val"; [self.dataresponse setvalue:string forkey:@"code"]; 

Comments

Popular posts from this blog

ios - iPhone/iPad different view orientations in different views , and apple approval process -

java Extracting Zip file -

C# WinForm - loading screen -