objective c - NSMutableDictionary always null -


i developing simple program creates soap message using nsmutabledictionary parameters. don't understand why nsmutabledictionary variable called other class return null value add values. tried setobject: forkey directly doesn't work.

this code:

soaplib.h @property(nonatomic,retain)nsmutabledictionary *parameters;

calculator.m soaplib *createsoap = [[soaplib alloc]init];

createsoap.envelope = @"http://schemas.xmlsoap.org/soap/envelope/"; createsoap.methodname = @"add"; createsoap.servicenamespace = @"http://calculator.me.org/";  nsmutabledictionary *parameters = [[nsmutabledictionary alloc]init]; [parameters setobject:[nsnumber numberwithint:2] forkey:@"i"]; [parameters setobject:[nsnumber numberwithint:3] forkey:@"j"];  nslog(@"calc parameters: %@",parameters);  <--- returns = 2, j = 3  [createsoap.parameters setdictionary:parameters]; <--- set  nslog(@"create soap param: %@", createsoap.parameters); <--- returns null 

just call:

createsoap.parameters = parameters; 

instead of

[createsoap.parameters setdictionary:parameters]; 

Comments

Popular posts from this blog

linux - xterm copying to CLIPBOARD using copy-selection causes automatic updating of CLIPBOARD upon mouse selection -

c++ - qgraphicsview horizontal scrolling always has a vertical delta -