码迷,mamicode.com
首页 > 移动开发 > 详细

iOS开发之UITableViewController

时间:2015-02-10 12:50:07      阅读:249      评论: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
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!