24 lines
327 B
Objective-C
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
|