自定义单元崩溃

时间:2013-04-08 07:29:25

标签: ios objective-c uitableview

我的自定义单元格有问题。它使用搜索,SBJson解析器和MDProgressHUD。一切都很好,除非我打开它,开始加载信息,我按下(还没有上传所有)下次我进入自定义单元格被窃听。它只显示我上次按下时的次数。重新加载表没有帮助,后面我清理所有数据。这是自定义单元格的代码:

#import "MemberCell.h"

@implementation MemberCell

@synthesize membINLINE = _membINLINE;
@synthesize membNAME = _membNAME;
@synthesize membTASK = _membTASK;
@synthesize membWORK = _membWORK;
@synthesize membFOTO = _membFOTO;

- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString  *)reuseIdentifier
{ self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
if (self) {} return self; }

- (void)setSelected:(BOOL)selected animated:(BOOL)animated
{ [super setSelected:selected animated:animated]; }

@end

这是开始加载的代码:

- (void)viewDidAppear:(BOOL)animated{
    if ([firstShow isEqualToString:@"0"]) {
        firstShow = @"1";

        self.navigationItem.hidesBackButton = YES;

        HUD = [[MBProgressHUD alloc] initWithView:self.view];
        [self.view addSubview:HUD];
        HUD.labelText = @"Loading";
        [HUD showWhileExecuting:@selector(getListMembers) onTarget:self withObject:nil animated:YES];

        self.filteredListItems = [NSMutableArray arrayWithCapacity:[self.memList count]];

        if (self.savedSearchTerm) {
            [self.searchDisplayController setActive:self.searchWasActive];
            [self.searchDisplayController.searchBar setText:savedSearchTerm];

            self.savedSearchTerm = nil;
        }

        [tableView reloadData];
        tableView.scrollEnabled = YES;
        self.navigationItem.hidesBackButton = NO;
    } else {
        [self checkForRefresh];
    }

    timer = [NSTimer scheduledTimerWithTimeInterval:600.0 target:self selector:@selector(checkForRefresh) userInfo:nil repeats:YES];
    [[NSRunLoop mainRunLoop] addTimer:timer forMode:NSRunLoopCommonModes];
   // NSLog(@"%@",memList);
}

0 个答案:

没有答案