美文网首页
object-c 字典类型

object-c 字典类型

作者: huanghaodong | 来源:发表于2019-08-09 15:41 被阅读0次

字典取值

options[@"money"]

设置字典

+ (NSDictionary *)configCallbackDataWithResCode:(NSInteger)resCode msg:(NSString *)msg data:(id)data
{
    NSMutableDictionary *resultDic = [[NSMutableDictionary alloc] init];
    
    msg = msg ?: @"";
    data = data ?: @"";
    
    [resultDic setValue:[NSNumber numberWithInteger:resCode] forKey:@"status"];
    [resultDic setValue:msg forKey:@"errorMsg"];
    [resultDic setValue:data forKey:@"data"];
    
    return resultDic;
}

相关文章

网友评论

      本文标题:object-c 字典类型

      本文链接:https://www.haomeiwen.com/subject/zxehjctx.html