Questions tagged [nsindexpath]

The NSIndexPath class represents the path to a specific node in a tree of nested array collections in Objective-C. This path is known as an index path.

Each index in an index path represents the index into an array of children from one node in the tree to another, deeper, node. For example, the index path 1.4.3.2 specifies the path shown below:

enter image description here

iOS adds programming interfaces to the NSIndexPath class of the Foundation framework to facilitate the identification of rows and sections in UITableView objects. The API consists of a class method and two properties. The indexPathForRow:inSection: method creates an NSIndexPath object from row and section index numbers. The properties return the row index number and the section index number from such objects

Resource

509 questions
0
votes
2 answers

removeObject from array based on index

Hi I have one viewController with a IBAction that adds a string to a Plist NSMutableArray. This Plist is then read into another viewController which is a tableView. This string from the Plist array populates a textField in a custom cell with the…
Alex McPherson
  • 3,185
  • 3
  • 30
  • 41
0
votes
3 answers

UITableView won't scroll to very bottom

I have a UITableView that has something like 30 cells in it. I successfully use the scroll to index method when I add a new cell, but it is not working (almost) when called at view did load. When it is called at view didload it scrolls to the…
michaela
  • 173
  • 1
  • 2
  • 13
0
votes
1 answer

How to change the UITableViewCell content view by IBAction?

I have a UITableView with many cells and all the cells are going into one xib view, i have 2 buttons in that xib view - Up, Down. What i want to do is to jump to the next/back cell content when pressing one of these buttons, the content view need…
Xtrician
  • 504
  • 3
  • 5
  • 14
-1
votes
3 answers

Access objects in custom UITableViewCells with same tag?

In my app, I use custom UITableViewCells loaded from a XIB. Each cell contains 4 objects, like a UIImageView, UILabel, UITextField, etc... I set the tag of each object in my cellforrowatindexpath so each object has the same tag which also is the row…
SimplyKiwi
  • 12,376
  • 22
  • 105
  • 191
-1
votes
5 answers

indexPathForSelectedRow returning wrong index

I want to get the some of the data of what is displayed in a cell when I'm tapping on a button which I placed in the cell. For this I have implemented used the indexPathForSelectedRow method. But when I'm tapping on the cell, the method is returning…
Akshay Yerneni
  • 103
  • 2
  • 11
-1
votes
1 answer

Get value of Dictionary in Swift 3 which key isn't a String

I have a dictionary used NSIndexPath as key. It works fine with Swift 2 but I can't find a solution to make it work with Swift 3. I don't want to use String as a key so please don't suggest it. // init fileprivate var cachedCellSizes: [NSIndexPath:…
HoangNA
  • 163
  • 1
  • 12
-1
votes
2 answers

NSIndexPath indexPathForItem:inSection: returning nonsensical value

What I mean by 'nonsensical' is that the item becomes a totally different integer from the one I pass in, and even after reading the iOS documentation, I don't know why. NSIndexPath* iPath = [NSIndexPath indexPathForItem:4 inSection:0]; I set a…
Erika Electra
  • 1,854
  • 3
  • 20
  • 31
-1
votes
2 answers

how to sort NSArray and access in NSString?

Below is the web API response I am storing in **NSArray**. How can I access in **NSString** based on index path? Below is preview of image banner : array( ( "abc.jpg" ), ( "abc1.jpg" ), ( "abc21.jpg" ), ( …
-1
votes
1 answer

Remove a key in the Dictionary and reload a TableView in Swift 2

I am creating an app that has a UITableView in a ViewController. The data that will be presented at TableView are in an NSDictionary. Let me explain how my project is to then ask my question: And my Swift Code: import UIKit class ViewController:…
James
  • 1,167
  • 1
  • 13
  • 37
-1
votes
5 answers

Find out indexPath of cell

I have a few UITableViewCells with the labels Test1, Test2, Test3, Test4 and Test5. How can I find out the indexPath of the cell which displays Test3? I don't wanna touch the cell or do something like this. Thanks for your answers! The cells: Core…
Vpor
  • 147
  • 1
  • 1
  • 7
-1
votes
1 answer

[__NSCFString name]: unrecognized selector sent to instance

odd issue, my application has a UITableView with three sections, each populated by a separate array. The end-goal is to have the ability to move cells from section to section, so I wrote the 'logic' in the UITableViewController. Unfortunately, if I…
-1
votes
2 answers

How to get the index path of a tableviewcell that's populated from an array?

I have a tableviewcell with 5 different cells. Each view has a label with one of the following inside of it. 1 textfields, 1 text, view 1, switch, or 1 slider. I am trying to find the tableviewcell for row at index path so I can retrieve the…
-1
votes
2 answers

Detail view not updating when UITableView rows are re-ordered

I have a UITableView that pushes to a Detail ViewController. In my tableview, my rows are draggable/re-arrangeable. However, when the rows are switched, the path stays the same when selecting the rows and the Detail View is presented. Example:…
-1
votes
1 answer

Deleting Row from UITableView changes information stored in other rows

Let's say there are 10 rows in my UITableView, each with its own unique information, and I delete row 4. After the action is completed, row 5 becomes row 4, row 6 becomes row 5, and so on. Well, Row 5 loads the data that was in row 4 before being…
-1
votes
1 answer

iOS - how do I specify the index path of every UICollectionViewCell?

I'm trying to use a CollectionView as a nice layout for my navigation buttons. I have a big If....else statement but I'm getting the error: Semantic Issue Property 'indexPath' not found on object of type 'UICollectionViewCell *' Here is the code…
1 2 3
33
34