---
title: "Creating index for NSIndexPath class method indexPathWithIndexes:length:"  
description: "Creating index for NSIndexPath class method indexPathWithIndexes:length:"  
author: "zack mathews"  
published: 2015-11-05  
updated: 2015-11-05  
canonical: https://www.mindstick.com/forum/33570/creating-index-for-nsindexpath-class-method-indexpathwithindexes-length  
category: "iphone"  
tags: ["iphone", "ios", "objective c"]  
reading_time: 1 minute  

---

# Creating index for NSIndexPath class method indexPathWithIndexes:length:

The [method](https://www.mindstick.com/forum/166/webservice-method) of NSIndexPath [class](https://www.mindstick.com/blog/165/generic-class-in-c-sharp) is:\

```
+(id)indexPathWithIndexes:(NSUInteger *)indexes length:(NSUInteger)length
```

My [problem](https://yourviews.mindstick.com/view/81399/tackling-the-problem-of-unemployment-during-corona-pandemic) is with [indexes](https://www.mindstick.com/articles/12525/indexes-in-sql-server), I [am unable](https://answers.mindstick.com/qa/95314/how-do-i-access-a-group-link-in-telegram-if-i-am-unable-to-access-the-link) to create indexes for the first [parameter](https://www.mindstick.com/blog/450/parameter-class-in-c-sharp)?\
In the [documentation](https://answers.mindstick.com/qa/30462/what-is-documentation) I was read it is as [Array](https://www.mindstick.com/articles/335/jagged-array-in-c-sharp-dot-net) of indexes to make up the [index](https://www.mindstick.com/blog/198/index-in-sql-server) [path](https://www.mindstick.com/articles/44333/4-expert-tips-on-how-to-pick-the-right-career-path), but expecting a (NSUinteger*), to create index path of 1.2.3.4 , is it simply an array of[ 1, 2, 3, 4 ] ?

## Replies

### Reply by Tarun Kumar

Your imagination is correct, it is like an array of NSUInteger, and the second parameter length is no of elements in the indexes array. \
So you can use it like that:

```
NSUInteger arrayOfIndexes[] = { 1, 2, 3, 4 };NSIndexPath *indexPath = [NSIndexPath indexPathWithIndexes:arrayOfIndexes   length: 4];
```


---

Original Source: https://www.mindstick.com/forum/33570/creating-index-for-nsindexpath-class-method-indexpathwithindexes-length

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
