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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T05:58:01+00:00 2026-06-11T05:58:01+00:00

My application was working fine, and a couple minutes later, after editing another part

  • 0

My application was working fine, and a couple minutes later, after editing another part of the app, it started throwing the EXC_BAD_ACCESS error from a view controller that I wasn’t even working on. The only thing I did between that I can think that may have affected it is, I Edit->Refractor->Convert to Obj-C ARC… I only did it it for a specified file also, not my whole project which is confusing. I was following this tutorial when I believe the error started happening… http://sonnyparlin.com/2011/12/pulltorefresh-ios-5-and-arc-tutorial/
Also, the app launches fine, it just crashes when a cell is clicked on in the tableview. Any help would be greatly appreciated!

Error happens on this line:

self.releaselink = [[sortedArray objectAtIndex:indexPath.row] objectForKey:@"link"];

Here’s my code where the error is originating from:

@implementation PressReleaseViewController

@synthesize releaselink;

UILabel *departmentNamesLabel;
CGRect *departmentNamesFrame;

- (void)viewDidLoad {

// Load path to plist and sort based on "name"

NSString *path = [[NSBundle mainBundle] pathForResource:
                  @"departments" ofType:@"plist"];
array = [[NSMutableArray alloc] initWithContentsOfFile:path];
NSSortDescriptor *descriptor = [[NSSortDescriptor alloc] initWithKey:@"name" ascending:YES];
sortedArray = [array sortedArrayUsingDescriptors:[NSArray arrayWithObject:descriptor]];
}

// How many sections are in the table

- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
return 1;
}

// Set how many rows of cells are in the table

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
return [sortedArray count];
}

// Set up table view and format for cells

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
UITableViewCell* cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:nil];

// Set text for each cell

cell.textLabel.text = [[sortedArray objectAtIndex:indexPath.row] objectForKey:@"name"];

return cell;
}

// Set how tall each cell is

- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
return 40;
}

// Set push to new view controller

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

self.releaselink = [[sortedArray objectAtIndex:indexPath.row] objectForKey:@"link"];

UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"MainStoryboard_iPhone" bundle: nil];
MainViewController *vc = [storyboard instantiateViewControllerWithIdentifier:@"main"];
[vc setReleaseLink:self.releaselink];
[self.navigationController pushViewController:vc animated:YES];

}

- (void)viewDidUnload {
pressReleases = nil;
[super viewDidUnload];
}
@end

Header file”

@interface PressReleaseViewController : UITableViewController {

IBOutlet UITableView *pressReleases;
NSArray *array;
NSArray *sortedArray;
NSString *releaselink;

}

@property (nonatomic, retain) NSString *releaselink;

@end
  • 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-11T05:58:02+00:00Added an answer on June 11, 2026 at 5:58 am

    EXC_BAD_ACCESS errors occur when your application attempts to access an object that has already been released. If the issue happened after you converted the project to ARC, then somewhere there is a Zealous release call being made (on behalf of ARC). Try making sortedArray a strong property of your class, and set the variable as :

    self.sortedArray = [array sortUsingDescriptor:...];
    

    That must be it, because sortUsingDescriptor: probably returns an autoreleased object. In a non-arc project you’d have to encapsulate that call with a retain call:

    [[array sortUsingDescriptor:...]retain];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm running a facebook app on localhost using wamp. My application is working fine
My Application was working fine. But as soon as i updated from ADT 16
i have used progress bar in my application..my application is working fine but the
I am using jsf2.0 with primefaces.My application was working fine with all browsers includes
I've got application settings working just fine. However, I'd like to be able to
i have developed a small application and was working fine on developing machine but
I have created an application in facebook,all is working fine except the publish to
I created one application, its working fine. I want to support my application in
I have developed my application in .Net and my installer is working fine. Now
hello i have created one windows application in c# .net and its working fine

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.