【问题标题】:reloadData not working when table is nested inside a UIView当表嵌套在 UIView 中时,reloadData 不起作用
【发布时间】:2011-10-14 19:52:04
【问题描述】:

我已经搜索过这个问题,但一无所获。在调用reloadData 时,我已经三次检查myTableView 是否链接到表格而不是nil,并且我提供给表格的新数组是新的而不是nil

但基本上,代码似乎可以工作。只是我需要关闭并重新打开要更新的表的视图。否则,当我单击应该更新表格的按钮时,它会将其变为空(直到我关闭并重新打开视图——然后我得到正确的数据)。

.H:

@interface AddressbookViewController : UIViewController <UITableViewDataSource, UITableViewDelegate>
{

    IBOutlet UIButton * A;
    IBOutlet UIButton * B;
    IBOutlet UIButton * C;
    IBOutlet UIButton * D;
    IBOutlet UIButton * E;
    IBOutlet UIButton * F;
    IBOutlet UIButton * G;
    IBOutlet UIButton * H;
    IBOutlet UIButton * I;
    IBOutlet UIButton * J;
    IBOutlet UIButton * K;
    IBOutlet UIButton * L;
    IBOutlet UIButton * M;
    IBOutlet UIButton * N;
    IBOutlet UIButton * O;
    IBOutlet UIButton * P;
    IBOutlet UIButton * Q;
    IBOutlet UIButton * R;
    IBOutlet UIButton * S;
    IBOutlet UIButton * T;
    IBOutlet UIButton * U;
    IBOutlet UIButton * V;
    IBOutlet UIButton * W;
    IBOutlet UIButton * X;
    IBOutlet UIButton * Y;
    IBOutlet UIButton * Z;
    IBOutlet UIButton * vcCorp;
    IBOutlet UIButton * vcLocal;
    IBOutlet UIButton * listUp;
    IBOutlet UIButton * listDown;
    IBOutlet UIButton * close;

    IBOutlet UIView *myView;
    IBOutlet UITableView * myTableView;
    NSMutableArray *tableArray;

    CrestronClient * cClient;
    CrestronControllerValues * CCV;
    int viewOptions;

}
@property (nonatomic, retain)  NSMutableArray *tableArray;
@property (nonatomic, retain) IBOutlet UITableView *myTableView;


- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil type:(int)viewoptions;

@end

.M

#import "AddressbookViewController.h"
#import "CrestronControllerValues.h"



@implementation AddressbookViewController
@synthesize myTableView,tableArray;

//viewOptions  =    1=videoconferenceLOCAL    2=videoconferenceCORP    3=telepresence  4=audioconference
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil type:(int)viewoptions
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization
        viewOptions = 1;
        viewOptions = viewoptions;
        tableArray = [[NSMutableArray alloc]initWithObjects:nil];

    }
    return self;
}


- (void)didReceiveMemoryWarning
{
    // Releases the view if it doesn't have a superview.
    [super didReceiveMemoryWarning];

    // Release any cached data, images, etc that aren't in use.
}

- (void)viewDidLoad
{
    [super viewDidLoad];

    CCV = [CrestronControllerValues sharedManager];
    cClient = [CrestronClient sharedManager];

    [vcLocal setSelected:TRUE];
    [vcCorp setSelected:FALSE];


    if (viewOptions>2) {
        A.hidden = true;
        B.hidden = true;
        C.hidden = true;
        D.hidden = true;
        E.hidden = true;
        F.hidden = true;
        G.hidden = true;
        H.hidden = true;
        I.hidden = true;
        J.hidden = true;
        K.hidden = true;
        L.hidden = true;
        M.hidden = true;
        N.hidden = true;
        O.hidden = true;
        P.hidden = true;
        Q.hidden = true;
        R.hidden = true;
        S.hidden = true;
        T.hidden = true;
        U.hidden = true;
        V.hidden = true;
        W.hidden = true;
        X.hidden = true;
        Y.hidden = true;
        Z.hidden = true;
        vcCorp.hidden = true;
        vcLocal.hidden = true;
        listUp.hidden = true;
        listDown.hidden = true; 
        //[myTableView setEditing:YES animated:YES];
        //[myTableView reloadData];

    }

    [A addTarget:self action:@selector(aPressed) 
                  forControlEvents:UIControlEventTouchUpInside];
    [B addTarget:self action:@selector(bPressed) 
                forControlEvents:UIControlEventTouchUpInside];
    [C addTarget:self action:@selector(cPressed) 
                forControlEvents:UIControlEventTouchUpInside];
    [D addTarget:self action:@selector(dPressed) 
                forControlEvents:UIControlEventTouchUpInside];
    [E addTarget:self action:@selector(ePressed) 
                forControlEvents:UIControlEventTouchUpInside];
    [F addTarget:self action:@selector(fPressed) 
                forControlEvents:UIControlEventTouchUpInside];
    [G addTarget:self action:@selector(gPressed) 
                forControlEvents:UIControlEventTouchUpInside];
    [H addTarget:self action:@selector(hPressed) 
                forControlEvents:UIControlEventTouchUpInside];
    [I addTarget:self action:@selector(iPressed) 
                forControlEvents:UIControlEventTouchUpInside];
    [J addTarget:self action:@selector(jPressed) 
                forControlEvents:UIControlEventTouchUpInside];
    [K addTarget:self action:@selector(kPressed) 
                forControlEvents:UIControlEventTouchUpInside];
    [L addTarget:self action:@selector(lPressed) 
                forControlEvents:UIControlEventTouchUpInside];
    [M addTarget:self action:@selector(mPressed) 
                forControlEvents:UIControlEventTouchUpInside];
    [N addTarget:self action:@selector(nPressed) 
                forControlEvents:UIControlEventTouchUpInside];
    [O addTarget:self action:@selector(oPressed) 
                forControlEvents:UIControlEventTouchUpInside];
    [P addTarget:self action:@selector(pPressed) 
                forControlEvents:UIControlEventTouchUpInside];
    [Q addTarget:self action:@selector(qPressed) 
                forControlEvents:UIControlEventTouchUpInside];
    [R addTarget:self action:@selector(rPressed) 
                forControlEvents:UIControlEventTouchUpInside];
    [S addTarget:self action:@selector(sPressed) 
                forControlEvents:UIControlEventTouchUpInside];
    [T addTarget:self action:@selector(tPressed) 
                forControlEvents:UIControlEventTouchUpInside];
    [U addTarget:self action:@selector(uPressed) 
                forControlEvents:UIControlEventTouchUpInside];
    [V addTarget:self action:@selector(vPressed) 
                forControlEvents:UIControlEventTouchUpInside];
    [W addTarget:self action:@selector(wPressed) 
                forControlEvents:UIControlEventTouchUpInside];
    [X addTarget:self action:@selector(xPressed) 
                forControlEvents:UIControlEventTouchUpInside];
    [Y addTarget:self action:@selector(yPressed) 
                forControlEvents:UIControlEventTouchUpInside];
    [Z addTarget:self action:@selector(zPressed) 
                forControlEvents:UIControlEventTouchUpInside];
    [listUp addTarget:self action:@selector(listUpPressed) 
                forControlEvents:UIControlEventTouchUpInside];
    [listDown addTarget:self action:@selector(listDownPressed) 
                forControlEvents:UIControlEventTouchUpInside];
    [close addTarget:self action:@selector(closedPressed) 
                forControlEvents:UIControlEventTouchUpInside];
    [vcCorp addTarget:self action:@selector(vcCorpPressed) 
                forControlEvents:UIControlEventTouchUpInside];
    [vcLocal addTarget:self action:@selector(vcLocalPressed) 
                forControlEvents:UIControlEventTouchUpInside];
    // Do any additional setup after loading the view from its nib.



    switch (viewOptions) {
        case 1:
            [self setTableArray:CCV.currentPhonebookEntriesVideoChat];
            break;
        case 2:
            [self setTableArray:CCV.currentPhonebookEntriesVideoChat];
            break;
        case 3:
            [self setTableArray:CCV.currentPhonebookEntriesTelepresence];
            break;
        case 4:
            [self setTableArray:CCV.currentPhonebookEntriesAudioChat];
            break;
        default:
            [self setTableArray:CCV.currentPhonebookEntriesVideoChat];
            break;
    } 

}

- (void)viewDidUnload
{
    [super viewDidUnload];
    // Release any retained subviews of the main view.
    // e.g. self.myOutlet = nil;
}

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
    return YES;
}

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{ 
        int startCounter = 0;
        switch (viewOptions) {
            case 1:
                startCounter = 308;
                break;
            case 2:
                startCounter = 308;;
                break;
            case 3:
                startCounter = 331;
                break;
            case 4:
                startCounter = 286;
                break;
            default:
                return nil;
                break;
        }
    if ([[tableArray objectAtIndex:indexPath.row]isEqualToString:@"< empty >"]) {
        NSLog(@"empty");
    }
        [cClient userDigitalPush:startCounter+indexPath.row];    

}

#pragma mark - Table view data source

- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
    return 1;
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{

    return [tableArray count];
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    static NSString *CellIdentifier = @"Cell";

    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
    if (cell == nil) {
        cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
    }
    cell.textLabel.text = [tableArray objectAtIndex:indexPath.row];


    return cell;
}
-(void)setTableArray:(NSMutableArray *)tablearray{

    [tableArray removeAllObjects];
    tableArray = tablearray;
    NSLog(@"testing %@",tableArray);
    //[myTableView performSelectorOnMainThread:@selector(reloadData) withObject:nil waitUntilDone:NO];  
    [self viewWillAppear:YES];

}

- (void)viewWillAppear:(BOOL)animated
{
    [super viewWillAppear:animated];

        [[self myTableView] reloadData];

}
-(void)aPressed
{
//    CCV = [CrestronControllerValues sharedManager];
//
//    NSLog(@"test %@", CCV.cameleonVersion);
//    NSLog(@"test %@", CCV.ipAddress);
//    NSLog(@"test %@", CCV.iPID);

}

-(void)bPressed
{

}

-(void)cPressed
{

}

-(void)dPressed
{

}

-(void)ePressed
{

}

-(void)fPressed
{

}

-(void)gPressed
{

}

-(void)hPressed
{

}

-(void)iPressed
{

}

-(void)jPressed
{

}

-(void)kPressed
{

}

-(void)lPressed
{

}

-(void)mPressed
{

}

-(void)nPressed
{

}

-(void)oPressed
{

}

-(void)pPressed
{

}

-(void)qPressed
{

}

-(void)rPressed
{

}

-(void)sPressed
{

}

-(void)tPressed
{

}

-(void)uPressed
{

}

-(void)vPressed
{

}

-(void)wPressed
{

}

-(void)xPressed
{

}

-(void)yPressed
{

}

-(void)zPressed
{

}
-(void)listUpPressed
{
    //viewOptions  =    1=videoconferenceLOCAL    2=videoconferenceCORP    3=telepresence  4=audioconference

    int startCounter = 0;
    switch (viewOptions) {
        case 1:
            startCounter = 318;
            break;
        case 2:
            startCounter = 318;;
            break;
        case 3:
            startCounter = 341;
            break;
        case 4:
            startCounter = 0;
            break;
        default:
            return nil;
            break;
    }
    [cClient userDigitalPush:startCounter];    
    if (viewOptions == 1 || viewOptions == 2) {
        [self setTableArray:CCV.currentPhonebookEntriesVideoChat];
    }else if(viewOptions == 3){
        [self setTableArray:CCV.currentPhonebookEntriesTelepresence];
    }else if(viewOptions == 4){
        [self setTableArray:CCV.currentPhonebookEntriesAudioChat];
    }
}

-(void)listDownPressed
{
    int startCounter = 0;
    switch (viewOptions) {
        case 1:
            startCounter = 318;
            break;
        case 2:
            startCounter = 318;;
            break;
        case 3:
            startCounter = 341;
            break;
        case 4:
            startCounter = 0;
            break;
        default:
            return nil;
            break;
    }
    [cClient userDigitalPush:startCounter+1];    
    if (viewOptions == 1 || viewOptions == 2) {
        [self setTableArray:CCV.currentPhonebookEntriesVideoChat];
    }else if(viewOptions == 3){
        [self setTableArray:CCV.currentPhonebookEntriesTelepresence];
    }else if(viewOptions == 4){
        [self setTableArray:CCV.currentPhonebookEntriesAudioChat];
    }
}
-(void)closedPressed
{
    [self.view removeFromSuperview];  
}

-(void)vcCorpPressed
{
    [cClient userDigitalPush:326];    
    [vcLocal setSelected:FALSE];
    [vcCorp setSelected:TRUE];

    [self setTableArray:CCV.currentPhonebookEntriesVideoChat];
}

-(void)vcLocalPressed
{
    [cClient userDigitalPush:325];    
    [vcLocal setSelected:TRUE];
    [vcCorp setSelected:FALSE];

    [self setTableArray:CCV.currentPhonebookEntriesVideoChat];
}


- (void)dealloc
{
    [myTableView release];
    [tableArray release];
    [cClient release];
    [super dealloc];
}
@end

【问题讨论】:

  • 我感觉部分问题是这个类是 UIViewController 的子类,而不是 UITableViewController,但它应该仍然是可能的
  • 你在设置表的委托和数据源吗?
  • 是的。就像我说我的表可以很好地加载数据(如果没有设置,我不会发生这种情况)它只是当 tableArray 更改并且发送了 reloaddata 命令时,tableview 变为空白,我需要关闭并重新打开它以获取我的表新数组
  • 我没有在你发布的代码中看到你这样做的地方。
  • ?不明白你的意思。在 .h 我有 UIViewController 并且链接在 IB 中完成

标签: objective-c ios cocoa-touch uitableview


【解决方案1】:

从我的发现看来是这样的

[tableArray removeAllObjects];

可能是我的问题。我认为这是一个时间问题,但即使在不同的线程上添加了 sleep(1) 后,我的问题也没有解决。

这里是工作代码。请注意,我从删除所有对象更改为单独删除每个对象。

#import "AddressbookViewController.h"
#import "CrestronControllerValues.h"



@implementation AddressbookViewController
@synthesize myTableView,tableArray;

//viewOptions  =    1=videoconferenceLOCAL    2=videoconferenceCORP    3=telepresence  4=audioconference
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil type:(int)viewoptions
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization
        viewOptions = 1;
        viewOptions = viewoptions;
       // tableArray = [[NSMutableArray alloc]initWithObjects:nil];

    }
    return self;
}


- (void)didReceiveMemoryWarning
{
    // Releases the view if it doesn't have a superview.
    [super didReceiveMemoryWarning];

    // Release any cached data, images, etc that aren't in use.
}

- (void)viewDidLoad
{
    [super viewDidLoad];

    CCV = [CrestronControllerValues sharedManager];
    cClient = [CrestronClient sharedManager];

    if (viewOptions == 1) {
        [vcLocal setSelected:TRUE];
        [vcCorp setSelected:FALSE];
    }else if(viewOptions == 2){
        [vcLocal setSelected:FALSE];
        [vcCorp setSelected:TRUE];
    }


    if (viewOptions>2) {
        A.hidden = true;
        B.hidden = true;
        C.hidden = true;
        D.hidden = true;
        E.hidden = true;
        F.hidden = true;
        G.hidden = true;
        H.hidden = true;
        I.hidden = true;
        J.hidden = true;
        K.hidden = true;
        L.hidden = true;
        M.hidden = true;
        N.hidden = true;
        O.hidden = true;
        P.hidden = true;
        Q.hidden = true;
        R.hidden = true;
        S.hidden = true;
        T.hidden = true;
        U.hidden = true;
        V.hidden = true;
        W.hidden = true;
        X.hidden = true;
        Y.hidden = true;
        Z.hidden = true;
        vcCorp.hidden = true;
        vcLocal.hidden = true;
        listUp.hidden = true;
        listDown.hidden = true; 

    }

    [A addTarget:self action:@selector(aPressed) 
                  forControlEvents:UIControlEventTouchUpInside];
    [B addTarget:self action:@selector(bPressed) 
                forControlEvents:UIControlEventTouchUpInside];
    [C addTarget:self action:@selector(cPressed) 
                forControlEvents:UIControlEventTouchUpInside];
    [D addTarget:self action:@selector(dPressed) 
                forControlEvents:UIControlEventTouchUpInside];
    [E addTarget:self action:@selector(ePressed) 
                forControlEvents:UIControlEventTouchUpInside];
    [F addTarget:self action:@selector(fPressed) 
                forControlEvents:UIControlEventTouchUpInside];
    [G addTarget:self action:@selector(gPressed) 
                forControlEvents:UIControlEventTouchUpInside];
    [H addTarget:self action:@selector(hPressed) 
                forControlEvents:UIControlEventTouchUpInside];
    [I addTarget:self action:@selector(iPressed) 
                forControlEvents:UIControlEventTouchUpInside];
    [J addTarget:self action:@selector(jPressed) 
                forControlEvents:UIControlEventTouchUpInside];
    [K addTarget:self action:@selector(kPressed) 
                forControlEvents:UIControlEventTouchUpInside];
    [L addTarget:self action:@selector(lPressed) 
                forControlEvents:UIControlEventTouchUpInside];
    [M addTarget:self action:@selector(mPressed) 
                forControlEvents:UIControlEventTouchUpInside];
    [N addTarget:self action:@selector(nPressed) 
                forControlEvents:UIControlEventTouchUpInside];
    [O addTarget:self action:@selector(oPressed) 
                forControlEvents:UIControlEventTouchUpInside];
    [P addTarget:self action:@selector(pPressed) 
                forControlEvents:UIControlEventTouchUpInside];
    [Q addTarget:self action:@selector(qPressed) 
                forControlEvents:UIControlEventTouchUpInside];
    [R addTarget:self action:@selector(rPressed) 
                forControlEvents:UIControlEventTouchUpInside];
    [S addTarget:self action:@selector(sPressed) 
                forControlEvents:UIControlEventTouchUpInside];
    [T addTarget:self action:@selector(tPressed) 
                forControlEvents:UIControlEventTouchUpInside];
    [U addTarget:self action:@selector(uPressed) 
                forControlEvents:UIControlEventTouchUpInside];
    [V addTarget:self action:@selector(vPressed) 
                forControlEvents:UIControlEventTouchUpInside];
    [W addTarget:self action:@selector(wPressed) 
                forControlEvents:UIControlEventTouchUpInside];
    [X addTarget:self action:@selector(xPressed) 
                forControlEvents:UIControlEventTouchUpInside];
    [Y addTarget:self action:@selector(yPressed) 
                forControlEvents:UIControlEventTouchUpInside];
    [Z addTarget:self action:@selector(zPressed) 
                forControlEvents:UIControlEventTouchUpInside];
    [listUp addTarget:self action:@selector(listUpPressed) 
                forControlEvents:UIControlEventTouchUpInside];
    [listDown addTarget:self action:@selector(listDownPressed) 
                forControlEvents:UIControlEventTouchUpInside];
    [close addTarget:self action:@selector(closedPressed) 
                forControlEvents:UIControlEventTouchUpInside];
    [vcCorp addTarget:self action:@selector(vcCorpPressed) 
                forControlEvents:UIControlEventTouchUpInside];
    [vcLocal addTarget:self action:@selector(vcLocalPressed) 
                forControlEvents:UIControlEventTouchUpInside];
    // Do any additional setup after loading the view from its nib.



    switch (viewOptions) {
        case 1:
            [self setTableArray:CCV.currentPhonebookEntriesVideoChat];
            break;
        case 2:
            [self setTableArray:CCV.currentPhonebookEntriesVideoChat];
            break;
        case 3:
            [self setTableArray:CCV.currentPhonebookEntriesTelepresence];
            break;
        case 4:
            [self setTableArray:CCV.currentPhonebookEntriesAudioChat];
            break;
        default:
            [self setTableArray:CCV.currentPhonebookEntriesVideoChat];
            break;
    } 

}

- (void)viewDidUnload
{
    [super viewDidUnload];
    // Release any retained subviews of the main view.
    // e.g. self.myOutlet = nil;
}

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
    return YES;
}

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{ 
        int startCounter = 0;
        switch (viewOptions) {
            case 1:
                startCounter = 308;
                break;
            case 2:
                startCounter = 308;;
                break;
            case 3:
                startCounter = 331;
                break;
            case 4:
                startCounter = 286;
                break;
            default:
                return nil;
                break;
        }
    if ([[tableArray objectAtIndex:indexPath.row]isEqualToString:@"< empty >"]) {
        NSLog(@"empty");
    }else{
        [cClient userDigitalPush:startCounter+indexPath.row];    

    }

}

#pragma mark - Table view data source

- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
    return 1;
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{

    return [tableArray count];
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    static NSString *CellIdentifier = @"Cell";

    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
    if (cell == nil) {
        cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
    }
    cell.textLabel.text = [tableArray objectAtIndex:indexPath.row];


    return cell;
}
-(void)setTableArray{
   //[tableArray removeAllObjects];

    //NSLog(@"set table array %@", CCV.currentPhonebookEntriesVideoChat);
    int counter =0;
    while ([tableArray count]>counter) {
        [tableArray removeObjectAtIndex:counter];
        counter++;
    }

    if (viewOptions == 1 || viewOptions == 2) {
        tableArray =CCV.currentPhonebookEntriesVideoChat;
    }else if(viewOptions == 3){
        tableArray =CCV.currentPhonebookEntriesTelepresence;
    }
    //[self.myTableView performSelectorOnMainThread:@selector(reloadData) withObject:nil waitUntilDone:NO];
    [[self myTableView] reloadData];
}



-(void)listUpPressed
{
    //viewOptions  =    1=videoconferenceLOCAL    2=videoconferenceCORP    3=telepresence  4=audioconference

    int startCounter = 0;
    switch (viewOptions) {
        case 1:
            startCounter = 318;
            break;
        case 2:
            startCounter = 318;;
            break;
        case 3:
            startCounter = 341;
            break;
        default:
            return nil;
            break;
    }
    [cClient userDigitalPush:startCounter];    
    [self setTableArray];
}

-(void)listDownPressed
{
    int startCounter = 0;
    switch (viewOptions) {
        case 1:
            startCounter = 318;
            break;
        case 2:
            startCounter = 318;;
            break;
        case 3:
            startCounter = 341;
            break;
        default:
            return nil;
            break;
    }
    [cClient userDigitalPush:startCounter+1];  
    NSLog(@"command sent");

    [self setTableArray];
}

-(void)closedPressed
{
    [self.view removeFromSuperview];  
}

-(void)vcCorpPressed
{
    [cClient userDigitalPush:326];    
    [vcLocal setSelected:FALSE];
    [vcCorp setSelected:TRUE];
    viewOptions = 2;
    [self setTableArray];

}

-(void)vcLocalPressed
{
    [cClient userDigitalPush:325];    
    [vcLocal setSelected:TRUE];
    [vcCorp setSelected:FALSE];
    viewOptions = 1;
    [self setTableArray];
}

这是 removeallobjects 第二次没有按我的预期工作。我要重新阅读文档,但我真的不明白为什么会出现问题。我正在清除数组,将其设置为新数组,它仍然是空的

and here is my answer

【讨论】:

    猜你喜欢
    • 2012-08-10
    • 2014-02-07
    • 1970-01-01
    • 2014-08-17
    • 2018-03-26
    • 2010-12-13
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多