Files
yinmeng-ios/xplan-ios/Base/Tool/Safe/NSArray+Safe.m
2022-11-11 15:11:14 +08:00

24 lines
327 B
Objective-C

//
// NSArray+Safe.m
// xplan-ios
//
// Created by 冯硕 on 2022/11/11.
//
#import "NSArray+Safe.h"
@implementation NSArray (Safe)
-(id)safeObjectAtIndex1:(NSUInteger)index{
if ([self isKindOfClass:[NSArray class]]){
if (self.count){
if (self.count>index){
return self[index];
}
}
}
return nil;
}
@end