首页 > 移动平台 > 详细

iOS开发之UITableViewController

时间:2015-02-10 12:49:55      阅读:232      评论:0      收藏:0      [点我收藏+]

# RssListController.h

@interface RssListController : UITableViewController <MWFeedParserDelegate>
{//Displaying
    NSArray *itemsToDisplay;
    NSDateFormatter *formatter;
}

// Properties
@property (nonatomic, strong) NSArray *itemsToDisplay;

@end

 

 # RssListController.m

@implementation RssListController

- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { // Return the number of sections. return 1; }
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    // Return the number of rows in sections.
    return itemsToDisplay.count;;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
  // Return init tableCell
}

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
   // Return selected action
}

#pragma mark - EditMode
//return edit status
- (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath
{
  // Return can edit.
    return YES;
}

//return delete style
- (UITableViewCellEditingStyle)tableView:(UITableView *)tableView editingStyleForRowAtIndexPath:(NSIndexPath *)indexPath
{
  // Return delete style
    return UITableViewCellEditingStyleDelete;
}

//return delete title
-(NSString *)tableView:(UITableView *)tableView titleForDeleteConfirmationButtonForRowAtIndexPath:(NSIndexPath *)indexPath {
  // Return delete name
    return @"删除";
}

//delete action
-(void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath
{
   // Return delete action
}
@end
 

 

iOS开发之UITableViewController

原文:http://www.cnblogs.com/ht-927/p/4283449.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!