| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879 |
- //
- // LogShareAndCommentModel.m
- // IBOSS
- //
- // Created by Dongke on 15/11/5.
- // Copyright © 2015年 elongtian. All rights reserved.
- //
- #import "LogShareAndCommentModel.h"
- #import "LogShareAndCommentInfoModel.h"
- @implementation LogShareAndCommentModel
- -(id)init
- {
- self =[super init];
- if(self){
- _shareCommentArr=[NSMutableArray new];
- }
- return self;
- }
- -(void)parseShareAndCommentArr:(NSArray *)arr{
- if(arr!=nil){
- [_shareCommentArr removeAllObjects];
- for(int i=0;i<arr.count;i++)
- {
- LogShareAndCommentInfoModel * info=[LogShareAndCommentInfoModel new];
- NSDictionary * dic=arr[i];
- [info ParseDic:dic];
- [_shareCommentArr addObject:info];
-
- }
- }
- }
- -(void)setShareAndCommentArr:(NSArray *)arr{
- [_shareCommentArr removeAllObjects];
- if(arr!=nil){
- [_shareCommentArr addObjectsFromArray:arr];
-
- }
- }
- -(BOOL)updateCellChecked:(NSString *)checkDocId{
- for (LogShareAndCommentInfoModel* model in _shareCommentArr) {
- if([model.userId intValue]==[checkDocId intValue]){
- model.isChecked=!model.isChecked;
- return model.isChecked;
- }
- }
- return NO;
- }
- -(BOOL)hasSameCode{
- return NO;
- }
- -(BOOL)isSelectAtLeastOne{
- BOOL s=NO;
- for (LogShareAndCommentInfoModel* model in _shareCommentArr) {
- if(model.isChecked){
- s=YES;
- break;
- }
- }
- return s;
- }
- -(NSArray *)checkedArr{
- NSMutableArray *tempArr=[NSMutableArray new];
- for (LogShareAndCommentInfoModel* model in _shareCommentArr) {
- if(model.isChecked){
- [tempArr addObject:model];
- }
- }
- return tempArr;
- }
- @end
|