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 8769127
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T17:15:11+00:00 2026-06-13T17:15:11+00:00

I try use storyboard with table view that segue to controller view that should

  • 0

I try use storyboard with table view that segue to controller view that should show me picture. The problem is that the app crush when I press on any “cell”.

this is the problem code:

- (void) prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender{

    if([[segue identifier] isEqualToString:@"ShowPhoto"])
    {
        DetailsViewController *dvc = [segue 
        destinationViewController];
        NSIndexPath *path = [[self tableView] indexPathsForSelectedRows];
        Photo *pic = [photosArray objectAtIndex:[path row]];

        [dvc setCureentPic: pic];
    }
}

the problem is the line with NSIndexPath… I think that the reason is that I try insert array into NSIndex.
xcode warning: Incompatible pointer types initializing ‘NSIndexPath *__strong’ with an expression of type ‘NSArray.

the crush message: unrecognized selector sent to instance [__NSArrayI row].
how can I solve the problem?

  • 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-13T17:15:13+00:00Added an answer on June 13, 2026 at 5:15 pm

    Please do read the documentation (here) of the methods you call instead of making assumptions about what they do…

    [[self tableView] indexPathsForSelectedRows]
    

    returns an NSArray and not an NSIndexPath (by the way, you could know this even without reading the docs – in Cocoa naming convention, if something is in plural, then it accepts or returns an NSArray), so sending it the messages of NSIndexPath will crash. Write

    NSIndexPath *path = [[[self tableView] indexPathsForSelectedRows] objectAtIndex:0];
    

    instead, and it will work (if there is at least one selected row – if not, you have to check for the array being empty, else it will crash again…)

    By the way, the compiler even warns you about what the problem is… Please try to develop some common sense before trying to do programming, because if not, you will shoot yourself and others in the foot.

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

Sidebar

Related Questions

I try to use the Detail Disclosure Button with the Storyboard, but when I
I try to use SQL SERVER VIEW within RIA Services. So I created some
I'm the beginner of IOS development. I try to use the Storyboard to produced
I have a problem with Automapper when I try use custom resolver which uses
I tried to use linq to get storyboard data in code and try following
i'm trying to code up a simple table view > detail app to start
I try use gssapi32.dll in my application but I receive exception when app start
I'm programmatically implement a list view controller. When I try to run the project,
I try use string as a regular expression pattern but I've following errors PHP
I try use a integer array in java with the code below: public static

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.