本文主要是介绍【Foundation-10-1】#import Foundation/NSArray.h,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
@interface NSArray : NSObject <NSCopying, NSMutableCopying, NSSecureCoding, NSFastEnumeration>
@property (readonly) NSUInteger count; // 数组数量
- (id)objectAtIndex:(NSUInteger)index; // 数组某位置的obj
- (instancetype)init NS_DESIGNATED_INITIALIZER; // 初始化
- (instancetype)initWithObjects:(const id [])objects count:(NSUInteger)cnt NS_DESIGNATED_INITIALIZER;// c 数组创建
- (instancetype)initWithCoder:(NSCoder *)aDecoder NS_DESIGNATED_INITIALIZER; // 编码创建
</pre><pre name="code" class="objc"> NSArray *arr2 = @[@"1",@"2"];NSInteger count = arr2.count;NSString *str = [arr2 objectAtIndex:1];// NSArray *arr3 = [[NSArray alloc]initWithCoder:<#(NSCoder *)#>];
@end
这篇关于【Foundation-10-1】#import Foundation/NSArray.h的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!