search

Home  >  Q&A  >  body text

objective-c - oc中怎么可以用括号括起来创建一个实例并设置属性

  self.tableView = ({
        UITableView *tableView = [[UITableView alloc] initWithFrame:CGRectMake(0, (self.view.frame.size.height - 54 * 5) / 2.0f, self.view.frame.size.width, 54 * 5) style:UITableViewStylePlain];
        tableView.autoresizingMask = UIViewAutoresizingFlexibleTopMargin | UIViewAutoresizingFlexibleBottomMargin | UIViewAutoresizingFlexibleWidth;
        tableView.delegate = self;
        tableView.dataSource = self;
        tableView.opaque = NO;
        tableView.backgroundColor = [UIColor clearColor];
        tableView.backgroundView = nil;
        tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
        tableView.bounces = NO;
        tableView;
    });
巴扎黑巴扎黑2901 days ago371

reply all(1)I'll reply

  • 天蓬老师

    天蓬老师2017-04-22 09:02:11

    /q/1010000000521467

    reply
    0
  • Cancelreply