加班~~~第三天之添加自定义方法
来源:互联网 发布:matlab结构矩阵 编辑:程序博客网 时间:2024/06/10 14:18
<span style="font-family: Arial, Helvetica, sans-serif;">+ (NSMutableDictionary *)addReplyCountNumber:(NSDictionary *)helpBroadDic</span>
{ if(helpBroadDic == nil || [helpBroadDic count] == 0) return nil; if([helpBroadDic objectForKey:kHelpBroadType] == nil) { NSInteger count = 0; NSMutableDictionary *helpDic = [[[NSMutableDictionary alloc] initWithDictionary:helpBroadDic] autorelease]; if ([helpDic objectForKey:kHelpAnswerCountKey]) { count = [[helpDic objectForKey:kHelpAnswerCountKey] integerValue]; } count ++; [helpDic setObject:[NSString stringWithFormat:@"%d",count] forKey:kHelpAnswerCountKey]; return helpDic; } NSInteger helpType = [[helpBroadDic objectForKey:kHelpBroadType] integerValue]; if (helpType == 1) { NSDictionary *helpBroad = nil; if([[helpBroadDic objectForKey:kHelpBroadKey] isKindOfClass:[NSArray class]]) { NSArray *arr = [helpBroadDic objectForKey:kHelpBroadKey]; if([arr count] > 0) { helpBroad = [arr objectAtIndex:0]; NSInteger count = 0; NSMutableDictionary *helpDic = [[NSMutableDictionary alloc] initWithDictionary:helpBroad]; if ([helpDic objectForKey:kHelpAnswerCountKey]) { count = [[helpDic objectForKey:kHelpAnswerCountKey] integerValue]; } count ++; [helpDic setObject:[NSString stringWithFormat:@"%d",count] forKey:kHelpAnswerCountKey]; NSMutableArray *helpArray = [[NSMutableArray alloc] initWithCapacity:0]; [helpArray addObject:helpDic]; [helpDic release]; NSMutableDictionary *helpBroadDicMuti = [[[NSMutableDictionary alloc] initWithDictionary:helpBroadDic] autorelease]; [helpBroadDicMuti setObject:helpArray forKey:kHelpBroadKey]; [helpArray release]; return helpBroadDicMuti; } } else if ([[helpBroadDic objectForKey:kHelpBroadKey] isKindOfClass:[NSDictionary class]]) { helpBroad = [helpBroadDic objectForKey:kHelpBroadKey]; NSInteger count = 0; NSMutableDictionary *helpDic = [[NSMutableDictionary alloc] initWithDictionary:helpBroad]; if ([helpDic objectForKey:kHelpAnswerCountKey]) { count = [[helpDic objectForKey:kHelpAnswerCountKey] integerValue]; } count ++; [helpDic setObject:[NSString stringWithFormat:@"%d",count] forKey:kHelpAnswerCountKey]; NSMutableDictionary *helpBroadDicMuti = [[[NSMutableDictionary alloc] initWithDictionary:helpBroadDic] autorelease]; [helpBroadDicMuti setObject:helpDic forKey:kHelpBroadKey]; [helpDic release]; return helpBroadDicMuti; } } return [NSMutableDictionary dictionaryWithDictionary:helpBroadDic];}重点看思路吧 思路很重要哈
0 0
- 加班~~~第三天之添加自定义方法
- 三天学好ADO之第三天
- 新环境之第三天
- 上海之行第三天
- MFC学习之第三天
- java之路第三天
- Html5笔记之第三天
- JavaScrpt笔记之第三天
- CSS3笔记之第三天
- struts2学习之第三天
- 敏捷个人之第三天
- 加班~~~第二天之自定义UIPageControl控件
- 我的android 第三天 - 自定义Toast
- UI 第三天 自定义视图 视图控制器
- php复习 第三天 自定义函数
- 第第一周第三天smarty自定义函数
- 《笨方法学python》的第三天
- android java开发 第三天 之 Activity 与 Service 绑定(activiey 调用service中方法)
- ios自用学习笔记-触摸事件与手势识别
- spring boot web相关配置
- Ubuntu下设置环境变量及PATH的方法
- 游戏上线,新起点,新征程
- 单元测试的小示例
- 加班~~~第三天之添加自定义方法
- 字符变换
- yii session详细说明
- View 小功能笔记小记
- canvas连线
- 欧美脑计划战略错误? 缺失一面镜子
- Power of Two
- [LeetCode][Java]Longest Palindromic Substring
- JAXB解析xml文件转换为POJO