// // NSMutableArray+proper.m // jiaPei // // Created by apple on 15/11/18. // Copyright (c) 2015年 JCZ. All rights reserved. // #import "MtArray+Setter.h" @implementation NSMutableArray(Setter) -(void)property:(id)obj forKey:(NSString*)key { if (self) { if (!obj) { obj = @""; } if (!key) { key = @""; } NSDictionary* dict = [NSDictionary dictionaryWithObjectsAndKeys:obj,key, nil]; [self addObject:dict]; } } -(void)addPro:(NSString*)name Value:(NSString*)value { [self property:value forKey:name]; } -(void)addHeader { } -(void)addFooter { [self addPro:@"isPage" Value:@""]; [self addPro:@"pageSize" Value:@"100"]; [self addPro:@"currentPage" Value:@"1"]; } @end @implementation NSArray(Setter) -(id)objAtPath:(NSIndexPath*)path { if (path.section < self.count ) { NSArray* subObj = self[path.section]; if([subObj isKindOfClass:[NSArray class]] || [subObj isKindOfClass:[NSMutableArray class]]) { if (path.row < subObj.count) { return [self[path.section] objectAtIndex:path.row]; } } } return nil; } @end