Skip to content

Instantly share code, notes, and snippets.

@lzwjava
Last active August 29, 2015 14:17
Show Gist options
  • Save lzwjava/3d8fe8e500bcd580cb4e to your computer and use it in GitHub Desktop.
Save lzwjava/3d8fe8e500bcd580cb4e to your computer and use it in GitHub Desktop.
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
Copy link
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