reloaddata

How to filter UICollectionView and keep keyboard up?

人走茶凉 提交于 2019-12-09 05:07:39
问题 I've added a UISearchBar to a UICollectionView and in the delegate searchBar:textDidChange: filter my model and call [collectionView reloadData] . reloadData (as well as reloadSection, etc) wants to take away firstResponder from the searchbar's textfield, thus dismissing the keyboard. I am trying to build a "live updating" filter and so it's annoying to have the keyboard go away after each character typed. Any ideas? 回答1: In searchBar delegate function , I use performBatchUpdates, first

refreshing cell content after deleting cells

烂漫一生 提交于 2019-12-08 12:23:11
问题 I have the following problem: I have a UITableView with some Text and some Images as content. The TextLabel of the cell displays the text and I add a UIView with some UIImageViews as its subview to the cells contentview. Everything works fine until I delete some cells. What happens is, I delete a cell (lets say the first) from the table, reload its data and e.g. then second cell moves one further up BUT! the UIView to the right contains the content from the first (deleted) cell. I dont know

UICollectionView stuck in reloadData

此生再无相见时 提交于 2019-12-07 08:13:05
问题 I'm having problems with [UICollectionView reloadData] , which seems to get stuck for quite a while before it calls numberOfSectionsInCollectionView on its delegate that I have specified. This is what happens: The app starts with the UICollectionView immediately visible and numberOfSectionsInCollectionView is called on the delegate, which returns the number of items in an empty array (i.e. 0) and immediately starts to download the data for the array from a web service. Once the download is

UICollectionView stuck in reloadData

微笑、不失礼 提交于 2019-12-05 11:50:41
I'm having problems with [UICollectionView reloadData] , which seems to get stuck for quite a while before it calls numberOfSectionsInCollectionView on its delegate that I have specified. This is what happens: The app starts with the UICollectionView immediately visible and numberOfSectionsInCollectionView is called on the delegate, which returns the number of items in an empty array (i.e. 0) and immediately starts to download the data for the array from a web service. Once the download is complete, the data is deserialized and added to the above array, then reloadData is called on the

reloadData in MasterView from DetailView

北慕城南 提交于 2019-12-04 20:40:25
I ran into an issue similar to this earlier on the iPhone, but the same solution doesn't seem to apply to the iPad environment. My goal is to call my method forceReload , defined in my RootViewController, that will reload the countdown_table's data in the RootView from the DetailView once a modal is dismissed. forceReload works fine when called directly from the RootViewController, but I can't seem to point to point to the RootViewController from the DetailView. I've tried using RootViewController *root_view = [self.splitViewController.viewControllers objectAtIndex:0]; [root_view forceReload];

UITableView reloadData taking too much time

佐手、 提交于 2019-12-04 15:23:26
I'm using TBXML+HTTP to get XML data from a website. What I want to do is populate a UITableView with the processed data. I've created a NSMutableArray that holds all the entries and, as far as that goes, everything is working fine. The problem is when, after successfully fetching the data from the server and storing it in the array, I try to update the table to show the data, using reloadData . It takes about 5 seconds to populate the table with 20 rows. The weird part is that the fetching is happening really fast, so the data is available right away. I do not understand what is taking so

[self.tableview reloadData]; causes flickering

假装没事ソ 提交于 2019-12-04 09:59:24
The problem is the UI appears and then gets updated : giving a flickering affect. I want the UI to be updated only once when user enters app, thus i've put reload in ViewDidLoad.. Here is the code .. Any help how can remove this flickering ... Some code example would help. - (void)viewDidLoad { [super viewDidLoad]; self.myTableView.dataSource = self; self.myTableView.delegate = self; PFQuery * getCollectionInfo = [PFQuery queryWithClassName:@"Collection"]; // make query [getCollectionInfo orderByDescending:@"updatedAt"]; [getCollectionInfo setCachePolicy:kPFCachePolicyCacheThenNetwork];

Refreshing a UICollectionview

南楼画角 提交于 2019-12-04 00:03:02
Does anyone know how to reload/refresh a UICollectionView while the collection view is being displayed? Basically I'm looking for something similar to the standard reloadData method for a UITableview. Firo You can just call: [self.myCollectionView reloadData]; Individual sections and items can also be reloaded: [self.myCollectionView reloadSections:indexSet]; [self.myCollectionView reloadItemsAtIndexPaths:arrayOfIndexPaths]; [self.collectionView reloadData]; The correct and best way is to use NSMutableArray *indexPaths = [NSMutableArray array]; //prepare some data //batchupdate as block [self

Self Sizing Cells make UITableView jump

巧了我就是萌 提交于 2019-12-03 11:58:47
问题 I've got a UITableView, each cell has an image and two labels, as you can see on the first picture So I am trying ti use self-sizing cells and everything is great, except 2 things: 1) First and Second cell don't show content properly, but after I scroll down and then return to them everything is ok. I tried to use [tableview reloadData] in viewDidAppear, but it doesn't help. Watch the labels at first they don't fit. You can watch it on this video https://www.youtube.com/watch?v=I9DGBl1c5vg

Reload Table view cell with animation (Swift)

杀马特。学长 韩版系。学妹 提交于 2019-12-03 11:33:56
问题 Is there a way to reload specific UITableView cells with multiple sections with animations? I've been using: self.TheTableView.reloadSections(NSIndexSet(index: 1), withRowAnimation: UITableViewRowAnimation.Right) This animates all the cells in the section though. The other option is to use: self.TheTableView.reloadRowsAtIndexPaths(<#indexPaths: [AnyObject]#>, withRowAnimation: <#UITableViewRowAnimation#>) EDIT: After using reloadRowsAtIndexPaths Terminating app due to uncaught exception