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
Post a Comment