Whenever I reload a UICollectionView twice , didSelectItemAtIndexPath is not called for some cells.
I am testing on iOS 9.3
Related
Basically I have a UIPageViewController which has multiple UICollectionView on each pages.
The problem is I can select/deselect on collectionViews inside the first page. But when I switch to second page, numberOfSections, numberOfItemsInSection, cellForItemAt are all called however the selection and deselection delegate methods are not called at all.
here is the link to the code:
https://gist.github.com/anonymous/4eca4ff9f3e4423c01974609aeae5482
I can't connect to your link. But you must make sure delegate of UICollectionView was set and check allowsMultipleSelection and allowsSelection is YES. You can reference links below:
UICollectionView - didDeselectItemAtIndexPath not called if cell is selected
iOS: UICollectionView cell selection not working
After migrating my Xcode 6 project to Xcode 7, only the first UICollectionView in my app renders properly.
When I switch tabs the CollectionView doesn't render properly.
The app worked fine in iOS 8.
Example:
Here is a CollectionView header in the Storyboard.
When I run my app, I am getting a blank view.
Interestingly enough, when I use the View Hierarchy debugger, it
shows that the element in fact does exist.
So it looks like ios9 has a bug when rendering custom cells.
I would suggest creating your custom cells in xibs and then loading them from there.
Make sure to include this in viewDidLoad:
self.collectionView.registerNib(UINib(nibName: "SongCell", bundle: NSBundle.mainBundle()), forCellWithReuseIdentifier: "SongCell")
self.collectionView.registerNib(UINib(nibName: "SongHeader", bundle: NSBundle.mainBundle()), forCellWithReuseIdentifier: "SongHeader")
Make sure you add this line in viewDidLoad of your collectionView controller
self.collectionView!.registerClass(YourCustomMemeClass.self, forCellWithReuseIdentifier: "reuseIdentifier")
I created an app for both IOS8 and IOS7 but I found a problem, I store on a sqlite DB some info that I need to show when the user opens a certain UIViewController that contains a UITableView. The problem is that when the user enters the UIViewController the tableView method gets fired:
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
return numProdotti; //this is the number of rows in my local DB, initially is 0
}
the I calculate the number of rows in my DB and on IOS8 the numberOfRowsInSection gets fired again, but on IOS7 it doesn't, so I just get an empty UITableView.
What am I missing?
UITableView will calculate the rows on the viewDidLoad method. This happens before you get a chance to do your own calculations. Therefore, once you have them, you need to call reloadData as suggested in the comments section. Odd and very slight behaviour change between iOS7 and 8.
I am working on an iOS 8 app that is using a UISplitViewController. I have a custom subclass of UISplitViewController and the app is working fine except for one small issue.
I have a button in my table view in the master that brings up a modal form sheet. The form sheet has a done button that is triggering an unwind segue that is handled in my custom subclass of UISplitViewController. This method gets called in all orientations on the iPhone and in landscape on the iPad but in portrait when the master view is a popup my method does not get called. It is like the split view is no longer in the chain so when iOS is looking for a controller that handles the unwind segue method it doesn't go all the way up to the split view. Has anyone seen this before and have any idea how to handle this situation?
I am working on a iOS7 application , I am presenting a modal view controller which contains a table view with custom cell. Custom cell contains a label and a textfield.
For iOS6 , my code is working perfect, but when I am running my application in iOS7 iPad, tableview delegate method tableView:didSelectRowAtIndexPath: does not get called.
Any help is appreciated.