reloaddata

Objective C - Correct way to empty and reload UITableViewController with NSMutableArray

北城余情 提交于 2019-12-25 08:16:03
问题 I have a UITableViewController which uses a NSMutableArray for it's datasource. The array is initially populated in the viewDidLoad method by calling a web service to retrieve the data and populate the NSMutableArray. The user then has the option to enter a search term (in a UISearchBar) and press Search to rerun the web service and repopulate the table list. At this point I need to empty the array and repopulate the table from the results of the web service. My question is what is the

(Swift) How to (animate) show/hide cells based on UITextfield input by reloading a UITableView?

两盒软妹~` 提交于 2019-12-25 07:59:41
问题 I'm a beginning iOS developer and I've been stuck on an issue for quite some time now. Background: I have a single viewcontroller with a tableview. It holds 4 dynamic prototype cells: prototypecell 1 has an UITextField and a couple of labels, prototypecell 2 has an image, prototypecell 3 and 4 only have a single label. (Note: prototype cell 4 is based on an array in the object and can have 1 or more cells) Upon opening the screen, only the first cell with the UITextField should be visible.

why reloadData shouldn't be called on methods that delete/insert rows

泄露秘密 提交于 2019-12-25 02:37:34
问题 I was trying to implement sparrow like row swiping that shows an action row (My starting point was this code). for each row I create.. I also create a 'backView' UITableViewCell that references the parent row.. so that when I click delete on the backView for example.. it knows which email to delete etc. Instead of using iOS's built in editing mode delete.. I just created a button on the backView and attached an event handler to it. the parent cell is the delegate of the back view.. and the

Angular 7 - Reload / refresh data different components

送分小仙女□ 提交于 2019-12-24 05:26:25
问题 How to refresh data in different component 1 when changes made in component 2. These two components are not under same parentnode. customer.service.ts export class UserManagementService extends RestService { private BASE_URL_UM: string = '/portal/admin'; private headers = new HttpHeaders({ 'Authorization': localStorage.getItem('token'), 'Content-Type': 'application/json' }); constructor(protected injector: Injector, protected httpClient: HttpClient) { super(injector); } getEapGroupList():

Reloading table causes flickering

爱⌒轻易说出口 提交于 2019-12-24 01:15:08
问题 I have a search bar and a table view under it. When I search for something a network call is made and 10 items are added to an array to populate the table. When I scroll to the bottom of the table, another network call is made for another 10 items, so now there is 20 items in the array... this could go on because it's an infinite scroll similar to Facebook's news feed. Every time I make a network call, I also call self.tableView.reloadData() on the main thread. Since each cell has an image,

Reporting crash on UITableview reloadData

一世执手 提交于 2019-12-24 00:36:48
问题 I'm getting a crash report from Crashlytics that is always in the same place but I'm unable to replicate the crash. It seems to be only users on iOS 9 and only very occasionally. I'm not sure if it's a code issue or something else. The last line mentions libdispatch.dylib as being missing, again, not sure if relevant. Crashlytics indicates that the crash occurs at MMDetailTableVC.m line 1407, which is the reloadData line. Here's what is reported: Crashed: com.apple.main-thread EXC_BAD_ACCESS

iOS UITableView reloadData only refreshes table the second time I call my reload function

六眼飞鱼酱① 提交于 2019-12-23 10:06:37
问题 Here is my reload function - (void) reloadTable:(id)sender { NSLog(@"Reload Table"); NSLog(@"%@",[appDelegate queryList]); [self.driverTable reloadData]; [self.driverTable setNeedsLayout]; [self.driverTable setNeedsDisplay]; } Here is where I call it after receiving data from the webservice if( [elementName isEqualToString:@"Response"]) { Response = NO; LookupView *lookupView = [[LookupView alloc] initWithNibName:@"LookupView" bundle:nil]; [lookupView reloadTable:self]; } Problem I have right

Why can't I call reloadData AND deselectRowAtIndexPath in viewWillAppear:animated at the same time?

有些话、适合烂在心里 提交于 2019-12-21 02:55:16
问题 I have a UITableView with cells that push viewControllers onto the stack when selected. The child viewControllers take user input and then pops off the stack. When the child viewController is popped, I want the parent tableView to update the value of the selected cell AND then deselect the row. I can update the cell using reloadData, and I can deselect the row using deselectRowAtIndexPath - but I can't do both at the same time . I understand why this is - reloadData deselects the cell

UITableView: reloadRows(at:) takes two hits for table to be updated and scroll every time

為{幸葍}努か 提交于 2019-12-20 06:08:52
问题 I have a table view (controller: MetricsViewController ) which gets updated from a CoreData database. I have used prototype cells ( MetricsViewCell ) which I have customized for my needs. It contains a segmented control, a UIView (metricsChart, which is used to display a chart - animatedCircle), and some UILabels. MetricsViewCell : class MetricsViewCell: UITableViewCell { var delegate: SelectSegmentedControl? var animatedCircle: AnimatedCircle? @IBOutlet weak var percentageCorrect: UILabel!

Swift UITableView reloadData in a closure

廉价感情. 提交于 2019-12-17 10:53:26
问题 I believe I'm having an issue where my closure is happening on a background thread and my UITableView isn't updating fast enough. I am making a call to a REST service and in my closure i have a tableView.reloadData() call but it takes a few seconds for this to happen. How do I make the data reload faster (perhaps on the main thread?) REST Query Function - using SwiftyJSON library for Decoding func asyncFlightsQuery() { var url : String = "http://127.0.0.1:5000/flights" var request :