<!--
{
  "availability" : [
    "iOS: 3.0.0 -",
    "iPadOS: 3.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.12.0 -",
    "tvOS: -",
    "visionOS: 1.0.0 -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CoreData",
  "identifier" : "/documentation/CoreData/NSFetchedResultsController/section(forSectionIndexTitle:at:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Core Data"
    ],
    "preciseIdentifier" : "c:objc(cs)NSFetchedResultsController(im)sectionForSectionIndexTitle:atIndex:"
  },
  "title" : "section(forSectionIndexTitle:at:)"
}
-->

# section(forSectionIndexTitle:at:)

Returns the section number for a given section title and index in the section index.

```
func section(forSectionIndexTitle title: String, at sectionIndex: Int) -> Int
```

## Parameters

`title`

The title of a section

`sectionIndex`

The index of a section.

## Return Value

The section number for the given section title and index in the section index

## Discussion

You would typically call this method when executing `UITableViewDataSource`’s <doc://com.apple.documentation/documentation/UIKit/UITableViewDataSource/tableView(_:sectionForSectionIndexTitle:at:)> method.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)