// // NSMutableArray+proper.m // jiaPei // // Created by apple on 15/11/18. // Copyright (c) 2015年 JCZ. All rights reserved. // #import "NSMutableArray+proper.h" @implementation NSMutableArray(proper) -(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)addPro2:(NSString*)name Value:(id)value { [self property:value forKey:name]; } @end @implementation NSArray(proper) -(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