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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T14:20:23+00:00 2026-05-25T14:20:23+00:00

this is my first post on here, though with the help of many questions

  • 0

this is my first post on here, though with the help of many questions and answers from members of this community, I have brought my project to near completion.

I have read multiple threads similar to what I’m asking, but the methods were completely different. No code has worked so far.

Basically (I say this because my code involves a lovely snake-like descent into a complicated mess, but applicable snippets will be put up upon request), my problem is that I’m calling

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath

and it pushes my viewcontroller in the simulator and NSLogs the string I need changed beautifully, but it pushes a blank view! The code for that run makes the view controller variable a constant:

UIViewController *viewController = [[xSheetMusicViewController alloc]initWithNibName:nil bundle:nil];

So I thought to myself, what am I doing!? So I went back to the old method, which involved making the UIViewcontroller an if-then, if-else-then statement that would push different views depending on whether certain rows were selected (standard stuff). Which pushed a new view with my string loaded perfectly, but it only NSLog’ed one string over and over! And the worst part was the my app would call either SIGABRT, or EXC_BAD_ACCESS when I tried returning to the rootviewcontroller. (here’s the applicable code):

UIViewController *viewController = [[[UIViewController alloc]init]autorelease];
if (indexPath.row == 0 && indexPath.section == 0) {
    appDelegate.baseURL = @"mussette.pdf";
viewcontroller = [[xSheetmusicViewController alloc]initwithnibname:nil bundle:nil];
}
else if (...)
//pushview, changestring, blah blah//

Now, I would prefer that my view push the PDF like it’s supposed to, and have the correct string value (and not give me SIGABRT or EXC_BAD_ACESS, but those are givens), but it seems that compromise is just out of my reach. I know there’s probably something stupid I’m doing that could be solved with one line of code, but for now, it seems hopeless.

Thanks in advance.

EDIT: To answer all of your questions, yes, there is no xib, rather an
(id)init
method in the next view.

EDIT 2: to answer lostInTransit’s request and add some additional details:

<else if (indexPath.row == 1 && indexPath.section == 0) {
    appDelegate.baseURL = @"Importing PDF's.pdf";

Also, if it helps, the output keeps logging:
Application tried to push a nil view controller on target .

When I try to push the view from a tableviewcell, and it did that before when it loaded the PDF right so I ignored it.

  • 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-05-25T14:20:24+00:00Added an answer on May 25, 2026 at 2:20 pm

    Question: why do you first initialize your viewController as a UIViewController and then again as xSheetmusicViewController? I think the problem is with releasing values properly. In one init, you do an autorelease, in the other you don’t. So chances are you are releasing a variable twice leading to the BAD ACCESS.

    Do you mind posting the “blah blah” 🙂 in the last piece of code?

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

Sidebar

Related Questions

This is my first post here and since I've seen many great answers I
This is my first post here and I wanted to get some input from
This is my first post here. I have a problem. I need to take
Well, this is my first post here and really enjoying the site. I have
this is my first post here on stackoverflow and am very impressed by the
My first post here, so i hope this is the right area. I am
This is my first time here so I hope I post this question at
This is my first post here and as I am at my wits end
My first post here – hoping you can help me with designing an algorithm
this is first post here and I am a noob programmer. This may be

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.