一,UITableView
1.UITableView继承自UIScrollView,可以分为Plain和Grouped两种风格。
例:
UITableView *aView = [[UITableView alloc]initWithFrame:CGRectMake(0, 0, 320, self.view.frame.size.height - 64) style:UITableViewStylePlain];
2.在UITableView的帮助文档中得到有两个协议,必须遵循 UITableViewDataSource,UITableViewDelegate,并且实现这个协议:
例:
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
二,UITableViewCell
typedef NS_ENUM(NSInteger, UITableViewCellStyle) {
UITableViewCellStyleDefault,
UITableViewCellStyleValue1,
UITableViewCellStyleValue2,
UITableViewCellStyleSubtitle
};
三,其他
代码报错之一:EXC_BAD_ACCESS .... 过度释放导致的崩溃。
int 转化 字符串 :stringWithFormat