1234567891011121314151617181920212223242526272829303132333435 |
- //
- // NSArray+ex.m
- // LNManager
- //
- // Created by EchoShacolee on 2017/6/5.
- // Copyright © 2017年 lee. All rights reserved.
- //
- #import "NSArray+ex.h"
- @implementation NSArray (ex)
- - (id)h_safeObjectAtIndex:(NSUInteger)index{
-
- if(self.count ==0) {
-
- // NSLog(@"--- mutableArray have no objects ---");
-
- return (nil);
-
- }
-
- if(index >MAX(self.count -1,0)) {
-
- // NSLog(@"--- index:%li out of mutableArray range ---", (long)index);
-
- return (nil);
-
- }
-
- return ([self objectAtIndex:index]);
-
- }
- @end
|