Questions tagged [indexpath]
167 questions
0
votes
1 answer
Index out of range in cell of UITableViewController - swift
I have a UITableViewController. In the code of the tableview I want to display a "lineLabel" (which is just a blank label with a background at the bottom of the cell), if a value is equal to another value - and I got that working pretty nice!
The…

D. Finna
- 467
- 2
- 7
- 19
0
votes
1 answer
Multi select in IOS
I am not sure what is wrong with the code below. All I'm doing is getting all the rows in the table and marking them as selected, and if they're already selected, I'm deselecting them. Whenever I try this, some of the row index paths are incorrect.…

Prashanth Kumar B
- 566
- 10
- 25
0
votes
1 answer
fatal error: Index out of range, when passing FirebaseData to tablviewCell
so I am working a food list project that I want to pass mealname/mealpic/mealDescription to my tableViewCell from FirebaseDatabase.
it will be something looks like this enter image description here
here's my FirebaesDatabase Structure
enter image…

Ian
- 239
- 1
- 14
0
votes
1 answer
The indexPath of a specific UITableViewCell is always nil
After the update to Xcode8 the following code doesn't work anymore
func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
let cell = collectionView.superview!.superview as! UITableViewCell
let…

T.Ho
- 1
-1
votes
1 answer
Hide or Delete first row/cell in indexPath
I try to hide or start the indexPath.row at 1. how can i achieved that ?. I already reversed the indexPath and make the count on numberOfRowsInSection - 1, So the list start from the buttom, but when i clicked on the list the content still not…

Rostadhi
- 1
-1
votes
1 answer
Finding the [indexpath.row] value in a TableView
Essentially I am attempting to change a variable when a specific row is selected however, the code is still printing -1. Here is all my code relating. I am trying to be able to click a certain tableview cell and then be able to print out that text.…

Mark
- 1
- 1
-1
votes
1 answer
If statement always evaluated, something always prints in cell
My problem is I returned the rows to be count, as a result when I try to run my code, the array in the UserDefaults is only evaluated to the first 4 objects. And even if the if statement = false, the. row will have a title as title and detailText as…

Benjamin Sloutsky
- 136
- 1
- 8
-1
votes
1 answer
Collection view loading only one cell at a time
Edited
I am using custom collection cells to load in collectionview. But when the collection view loadeds expecting behaviour cellforindex delegate will call for 3 indexpath but in this case only calling 0th indexpath 3 time.
override func…

Anju
- 563
- 2
- 6
- 13
-1
votes
1 answer
Updating CoreData through UISwipeGestureRecognizer on custom UITableViewCell?
I am adding a custom swipe gesture on a UITableViewCell that updates CoreData when a specific cell is swiped. However, I am having trouble passing the indexPath of the swiped cell to the function that will modify the CoreData. I am not using a Table…

gmdev
- 2,725
- 2
- 13
- 28
-1
votes
1 answer
How to compare and display different array count in numberOfRowsInSection in tableview in swift
I have tableview with label, i need to display different array count in tableview for different category. for that i have taken different arrays for different category but i am unable to check condition, all the time the condition goes to outer…

Swift
- 1,074
- 12
- 46
-1
votes
2 answers
How to get Last Selected row and Current Selected Row from UITableview swift?
I am trying to get the previously selected row and the currently selected row from the UITableview didSelectRowAt method.
The didSelectRowAt method only provides the row that was selected.
Is there a way to know which row was selected before…

jo solution
- 401
- 5
- 18
-1
votes
1 answer
Swift - Cannot subscript a value of type '[Array]' with an index of type 'IndexPath'
I have three arrays. One displays headers for each section on the tableView, one displays titles, and one has the links for each cell. When I run this code, I get:
Cannot subscript a value of type '[Array]' with an index of type 'IndexPath'
This…

Karrar Al-Mimar
- 4,199
- 3
- 12
- 15
-1
votes
2 answers
How can I get the index path.row of first table view to use it in the second table view using Swift3 , Xcode8
I have two table views in my project , Can any one help me to get the index path.row of first table view which is the main table to use in the second table view which is the sub table of the main table.
this is My mainTableView.
import UIKit
…

Zaid Mustafa
- 1
- 4
-2
votes
2 answers
(SWIFT 4) How to calculate sum of the columns indexpath.row in the tableview?
how to calculate the sum of the same columns in different cells, not the sum in the same cell.
I don't know how to solve it.
import UIKit
class ResultViewController: UIViewController, UITableViewDataSource, UITableViewDelegate, UITextFieldDelegate…

dinggu
- 111
- 7
-2
votes
1 answer
Hot to get index path for existing object in collection view
I got an array with objects, and populate the collection view with them. For example I have 3 objects inside my collection view. Is there a way, to receive the current index path based on the object name?
Thanks

Antonio K
- 144
- 11