Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7932577
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T21:03:41+00:00 2026-06-03T21:03:41+00:00

I am using ARC and want to create a method that passes in an

  • 0

I am using ARC and want to create a method that passes in an indexPath by reference so I can change its value:

-(void)configureIndexPaths:(__bridge NSIndexPath**)indexPath anotherIndexPath:(__bridge NSIndexPath**)anotherIndexPath
{
      indexPath = [NSIndexPath indexPathForRow:*indexPath.row + 1 inSection:0];
      anotherIndexPath = [NSIndexPath indexPathForRow:*anotherIndexPath.row + 1 inSection:0];
}

But this gives me a property row not found error. How can I address this.

And another conceptual question: if my my goal is just to change the value of indexPath that was passed in to the method, couldn’t passing by pointer also do that? Why would I choose to pass by reference rather than pass by pointer?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T21:03:42+00:00Added an answer on June 3, 2026 at 9:03 pm

    This is how you would do this:

    -(void) configureIndexPaths:(NSIndexPath*__autoreleasing *)indexPath anotherIndexPath:(__bridge NSIndexPath*__autoreleasing *)anotherIndexPath
    {
        if (indexPath)
            *indexPath = [NSIndexPath indexPathForRow:[(*indexPath) row] + 1 inSection:0];
        if (anotherIndexPath)
            *anotherIndexPath = [NSIndexPath indexPathForRow:[(*indexPath) row] + 1 inSection:0];
    }
    

    You should use __autoreleasing, so that the objects are properly autoreleased when they are created, as well as checking for a NULL pointer being passed in. If you want a true pass-by-reference, look into objc++ and a NSIndexPath *&.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an iOS app that I want to convert to using ARC .
I want to know if my Xcode iPhone project is using ARC, and I
I want to bring a single Objective-C class written using ARC into an old
for iOS 5.0 using ARC, here is something I want to implement and need
I have a 64bit application using ARC, that is serving up a distributed object.
for an iOS 5.0 application using ARC, i have an NSArray of objects that
I have written a method (shown below). The project is compiled using ARC, but
I have an array problem that i want to overcome, if i change the
I want to create an outer glow effect for arc shapes in my canvas
I'm writing an app (in iOS 5 using ARC!) that presents several hundred objects

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.