Sportica   Sportica

obj-c --NSMutableDictionary 存取字

NSMutableDictionary *d = [NSMutableDictionary dictionary];
    
    
    [d setObject:@"qingjoin" forKey:@"serveraddr"];
    [d setObject:@"pwdpwd" forKey:@"userpwd"];
    NSLog(@"%@",d);
    //新建一个对象。
    id ontest = [d objectForKey:@"serveraddr"];
    id sectest = [d objectForKey:@"userpwd"];
    NSLog(@"%@",ontest);
    NSLog(@"%@",sectest); 
    结果:
    serveraddr = qingjoin;
    userpwd = pwdpwd;

    qingjoin
    pwdpwd
posted @ 2012-06-29 18:00  qingjoin  阅读(228)  评论(0编辑  收藏  举报
  Sportica