iOS开发之UITableViewController

# 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
 

 

郑重声明:本站内容如果来自互联网及其他传播媒体,其版权均属原媒体及文章作者所有。转载目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。