0

(解決済み) 最初にいくつかのオブジェクトで満たされた UITableView があります。使用中、tableView の NSMutableArray はいくつかの新しい項目を取得しています。しかし、私が行う[myTableView reloadData];と、何も起こりません。myTableView はヘッダー ファイルの IBOutlet です。

何か案は?:/

編集:これがtableViewの私の方法です:

-(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
    // Return the number of sections.
    return 1;
}

-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    // Return the number of rows in the section.
    return [self.mutableArrayFuerTableView count];
}

-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    UITableViewCell *cellFavoriten = [tableView dequeueReusableCellWithIdentifier:@"favoritenCell"];
    NSString *favoritenString = [self.mutableArrayFuerTableView objectAtIndex:indexPath.row];

    cellFavoriten.textLabel.text = favoritenString;

    return cellFavoriten;
}

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
    // Do some stuff when the row is selected
    [tableView deselectRowAtIndexPath:indexPath animated:YES];
}

これはviewDidLoadにあります:

self.myTableView.dataSource = self;

self.favoritenArray = [NSMutableArray arrayWithCapacity:300];

defaultsFuerFavoritenTableView = [NSUserDefaults standardUserDefaults];

mutableArrayFuerAnderenMutableArray = [defaultsFuerFavoritenTableView objectForKey:@"favoritenKeyUserDefaults"];

mutableArrayFuerTableView = [NSMutableArray arrayWithArray:mutableArrayFuerAnderenMutableArray];
4

0 に答える 0