//用BLOCK快速遍历数组
NSArray *arr = @[@"a",@"b",@"c",@"d",@"e"];
[arr enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) {
NSLog(@"obj=%@,index=%zi", obj, idx);
}];
NSArray *arr = [NSMutableArray array];
NSSet *s = [NSSet set];
NSString *str = [s anyObject];
// NSDictionary*dict = [NSDictionary dictionaryWithObject:@"小妹"forKey:@"he"];
//字典无序!!!!!
NSDictionary *dict = @{@"she": @"小妹",@"he": @"小哥",@"he2": @"小哥",@"she1": @"小妹",@"he3": @"小哥",@"he4": @"小哥"};
// NSLog(@"%@", [dictobjectForKey:@"he"]);
[dict enumerateKeysAndObjectsUsingBlock:
^(id key, id obj, BOOL *stop) {
NSLog(@"%@,%@",key,obj);
}];
NSLog(@"%@,%zi", dict[@"he"], dict.count);
NSNumber 将基本数据类型封装成对象
NSNumber *num= [NSNumber numberWithInt:10];
NSDictionary*dict = @{@"age" : num};
int num1 = [num intValue];
//@20 NSNumber对象
NSDictionary *dict = @{@20 : @"age"};
NSLog(@"%@", dict[@20]);
CGPoint p = CGPointMake(10, 10);
NSValue *value = [NSValue valueWithPoint:p];
//NSDate
NSDate *date= [NSDate date];
//[NSDate dateWithTimeIntervalSinceNow:8*60*60];
//NSLog(@"%@", date);
NSDateFormatter*formatter = [[NSDateFormatter alloc] init];
formatter.dateFormat = @"yyyy-MM-dd HH:mm:ss";
//NSString *str = @"2014-04-23 17:11:22";
NSString *dateStr =[formatter stringFromDate:date];
NSLog(@"%@", dateStr);