#import <Foundation/Foundation.h>
int main(int argc, const char * argv[]) {
@autoreleasepool {
NSArray *officeSupplies = @[@"Pencils",@"Paper"];
NSLog(@"first: %@",officeSupplies[0]);
NSLog(@"all: %@",officeSupplies);
BOOL containsItem = [officeSupplies containsObject:@"Pencils"];
NSLog(@"need pencils: %d",containsItem);
NSLog(@"count: %d",(int)[officeSupplies count]);//@是objc对c的扩展,每见到@就认为是objc的特性
}
return 0;
}
objc使用函数
最新推荐文章于 2024-08-26 16:34:35 发布