didselectrowatindexpath

How to implement only single cell selection in each section in the tableview in iOS, Objective C

可紊 提交于 2019-12-12 10:24:37
问题 I have a table view with 5 sections and I have set the tableview selection to multiple. Each section have different number of rows. What I want is to set that the user can select only one cell from each section(in my table user can select any number of cells). ex: 5 cells from 5 sections. It should be impossible to select more than one cell from any section. If user select another cell from same section, previously selected cell should be deselected. How can I do this. This is a sample

How to UIActivityIndicatorView during perform segue?

拜拜、爱过 提交于 2019-12-12 02:58:29
问题 I’m building an article reading app. I’m using AMSliderMenu (https://github.com/SocialObjects-Software/AMSlideMenu) library for menu list. I am unable to implement UIActivityIndicator , when i click on table cell in AMSlideMenu it takes time to load another view because data is load into anther view. I want to give UIActivityIndicator when user click on cell UIActivityIndicator perform till the time it opens another view. Here is my code: - (void)tableView:(UITableView *)tableView

How to get the values of selected cells of a UITableView in one string

£可爱£侵袭症+ 提交于 2019-12-12 02:46:51
问题 i'm pretty sure this is really simple. But i can't get to make this work. I have a UITableView where i display dynamically a list of facebook friends, thanks to their FBID. Basically, i would like to return the FBIDs of the friends i selected, in one string separated with commas. If possible, in a IBAction, so i can pass them into parameters of a php. For example, let's pretend i have a list of 4 friends, A B C D, and their ids are 1,2,3,4. If i select A and C, i would like to have a string

Swift 2 - Fatal Error when `didDeselectItemAtIndexPath` is called

丶灬走出姿态 提交于 2019-12-11 12:05:12
问题 I have a UICollectionView where I use the function didSelectItemAtIndexPath to select a cell and change its alpha. In the UICollectionView there are 12 cells. In Order to take the deselected cells back to alpha = 1.0 I use the function didDeselectItemAtIndexPath . So far the code works however, when I select a cell and I scroll the UICollectionView the app crashes on the line let colorCell : UICollectionViewCell = collectionView.cellForItemAtIndexPath(indexPath)! inside the deselect function

iOS NSPredicate not working?

☆樱花仙子☆ 提交于 2019-12-11 09:53:07
问题 I have a simple predicate function that follows as: [totalSentences addObjectsFromArray:[firstLangEx filteredArrayUsingPredicate:[NSPredicate predicateWithFormat:@"(SELF contains[c] %@)", cellText]]]; This line works in one of my apps, however it does not work when I copied this into another app and tried testing this. totalSentences is a global NSMutableArray firstLangEx is a local NSArray filled with several lines cellText is NSString *cellText = cell.textLabel.text; All these codes exist

didSelectRowAt called only on multitouch

℡╲_俬逩灬. 提交于 2019-12-10 11:34:21
问题 What can make UITableViewCell detect only multitouch? If I tap with one finger it doesn't call didSelectRowAtIndex . Here is my Code: func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { let cell = tableView.dequeueReusableCell(withIdentifier: "bookingSettingsCell", for: indexPath) as! SettingsTableViewCell if indexPath.row < 3 { cell.settingSwitch.removeFromSuperview() } cell.settingTitle.text = dataForSetting[indexPath.row].first if dataForSetting

prepareForSegue after UISearchDisplayController

此生再无相见时 提交于 2019-12-10 10:43:27
问题 EDIT: I just found: How to segue from a UISearchBarDisplayController result to a detailViewController which I'll take a look at! I'm combining a 'search bar and search display controller' with core data fetchedResultsController using storyboard. That is, I have to differentiate between: if (self.tableView == self.searchDisplayController.searchResultsTableView) { ... and the case where I've just listed the results fetched from the data store. However, I'm having trouble getting the right row

Send variable value to next view controller when click a table cell

你离开我真会死。 提交于 2019-12-09 04:22:31
I have two table view controllers InvoiceList view controller InvoiceShow view controller I use didSelectRowAtIndexPath method as bellow to get selected table cell specific value override func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) { let rowObject = objects[indexPath.row] let invoicehash = rowObject["hash_key"]! } i need to send invoicehash value to InvoiceShow controller when click the table cell of InvoiceList i tried to use prepareForSegue function. but it is not applicable because it will trigger before the didSelectRawAtIndexPath function. so

didSelectRowAtIndexPath called after long press

半腔热情 提交于 2019-12-09 03:42:52
问题 I have a uitableview right below a uitextfield that populates similar strings in a uitableview cell . The items get populated. However the didSelectRowAtIndexPath gets called after long press My UITableView (is embedded in UIScrollView) - didSelectRowAtIndexPath: only being called after long press on custom cell My view hierarchy: UIScrollView (outerscroll) Some other views and buttons UITexfield UITableView (tableView) My Code class MyViewController: BaseViewController , UITextFieldDelegate

UITableView checkmarks duplicated

半世苍凉 提交于 2019-12-08 16:30:30
I keep getting checkmarks being marked in other sections of my table view when I click a row. Im not certain if I need to set my accessoryType. I tried mytableView.reloadData() however that didn't help either. var selected = [String]() var userList = [Users]() @IBOutlet weak var myTableView: UITableView! @IBAction func createGroup(_ sender: Any) { for username in self.selected{ ref?.child("Group").childByAutoId().setValue(username) print(username) } } func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { let myCell = tableView.dequeueReusableCell