模块式写法
self.tableView = ({
UITableView *tableView = [[[UITableView alloc] initWithFrame:CGRectMake(60, 40, self.view.frame.size.width, self.view.frame.size.height) style:UITableViewStylePlain] autorelease];tableView.autoresizingMask = UIViewAutoresizingFlexibleTopMargin | UIViewAutoresizingFlexibleBottomMargin | UIViewAutoresizingFlexibleWidth;
tableView.delegate = self;
tableView.dataSource = self;
tableView.opaque = NO;
tableView.backgroundColor = [UIColor clearColor];
tableView.backgroundView = nil;
tableView.backgroundColor = [UIColor clearColor];
tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
tableView.bounces = NO;
tableView;
});
[NSArray objectAtIndex:idx]方法可用NSArray[idx]替代
最大值与最小值FLT_MAX(float最大值)UINT_MAX INT_MAX
隐藏键盘
[[UIApplication sharedApplication] sendAction:@selector(resignFirstResponder) to:nil from:nil forEvent:nil];