123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384 |
- //
- // NSMutableArray+proper.m
- // jiaPei
- //
- // Created by apple on 15/11/18.
- // Copyright (c) 2015年 JCZ. All rights reserved.
- //
- #import "NSMutableArray+RQExtension.h"
- @implementation NSMutableArray(RQExtension)
- -(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(RQExtension)
- -(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
|