# 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
时间: 2024-09-30 21:29:44