Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
MCTestViewController.m
//
// MCTestViewController.m
// ClassNet
//
// Created by lzw on 15/3/26.
// Copyright (c) 2015年 lzw. All rights reserved.
//
#import "MCTestViewController.h"
@interface MCTestViewController ()
@property (nonatomic,strong) UITableView* tableView;
@end
@implementation MCTestViewController
- (void)viewDidLoad {
[super viewDidLoad];
[self.view addSubview:self.tableView];
}
-(UITableView*)tableView{
if(_tableView==nil){
_tableView=[[UITableView alloc] initWithFrame:self.view.frame];
_tableView.delegate=self;
_tableView.dataSource=self;
}
return _tableView;
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
return 1;
}
-(UITableViewCell*)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
UITableViewCell* cell=[[UITableViewCell alloc] init];
cell.textLabel.text=@"text";
return cell;
}
-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
return 44;
}
// Row display. Implementers
@lzwjava

This comment has been minimized.

Copy link
Owner Author

lzwjava commented Mar 26, 2015

import <UIKit/UIKit.h>

@interface MCTestViewController : UIViewController<UITableViewDataSource,UITableViewDelegate>

@EnD

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.