0

I am devloping an application "view based" and I used Table View in it

I was able to view all the strings in the table but not any variable

- (void)updateView{
    [listData dealloc];
    listData = [[NSMutableArray alloc] init];
    NSString *testString = forecast.routeNo;
    [listData addObject:@"first"];
    [listData addObject:[NSString stringWithFormat:@"%@", testString]];
    NSLog(@"this is the forecast routeNo = %@", testString);
}

the value of the string instially null but it is changing which i can see it debugger, but not in the table

so i can see the correct value in the debugger but when ever it is updated with the new value it doesn't update in the table view

so my question is it enough to change the values in the array or should i call some method or is it something else

Thanks

3 Answers 3

2

Add

[self.tableView reloadData];

at the end of the function.

Sign up to request clarification or add additional context in comments.

Comments

0

It's a bit hard to follow what you're saying, but I think what you're doing is updating the UITableView's data source, but not telling it that the data has changed.

As such, if you simply call your UITableView's reloadData method, the table should update with the new data.

Comments

0

You have to delegate the tableView to the self

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.