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

  • Home
  • SEARCH
  • 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 929275
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T20:08:39+00:00 2026-05-15T20:08:39+00:00

I am working with a UITableViewController. The method that fails is: – (void) testLoc

  • 0

I am working with a UITableViewController. The method that fails is:

- (void) testLoc {
    self.dictionary = [self.delegate getLocationsWithLatitude:@"0.0" longitude:@"0.0"]; //HERE
    [self setUpTableArray:dictionary]; 
}

Test results have shown that the exception is thrown in the first line of testLoc.

- (NSDictionary *) getLocationsWithLatitude:(NSString *)latitude longitude:(NSString *)longitude;

All I do in the above method is make an HTTP request and return an NSDictionary.

Below is my viewDidLoad (the first method call, which works) for the UITableViewController:

- (void)viewDidLoad {
    self.delegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
    [self testLoc];
    [super viewDidLoad];
}

And here is my viewWillAppear, which I get “unrecognized selector” from:

- (void)viewWillAppear:(BOOL)animated {
    self.delegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
    [self testLoc];
    [super viewWillAppear:animated];
}

Here is the error that I am getting:

-[NSCFString key]: unrecognized selector sent to instance 0x141770

The reason I am doing this is because I have a table view that I want to update every time I tab back to it with a tab bar.

This is for the first real app that I am building, and I would really appreciate any kind of insight. Thanks!!

UPDATE

Here is getLocationsWithLatitude:

- (NSDictionary *) getLocationsWithLatitude:(NSString *)latitude longitude:(NSString *)longitude {
OAMutableURLRequest *locationsRequest = [[OAMutableURLRequest alloc] initWithURL:[NSURL URLWithString:@"http://somerequesturl"] 
                                                                        consumer:self.globals.consumer 
                                                                           token:self.globals.requestToken 
                                                                           realm:nil signatureProvider:nil];
[locationsRequest setHTTPMethod:@"GET"];

[locationsRequest setParameters:[NSArray arrayWithObjects:
                                 [OARequestParameter requestParameter:@"geolat" value:latitude],
                                 [OARequestParameter requestParameter:@"geolong" value:longitude],
                                 nil]];

[locationsRequest prepare];
NSData *locationsData = [NSURLConnection sendSynchronousRequest:locationsRequest returningResponse:nil error:nil];
NSString *locationsString = [[[NSString alloc] initWithData:locationsData encoding:NSUTF8StringEncoding] autorelease];

    [locationsRequest release];
    SBJSON *jsonParser = [SBJSON new];
    NSError *error = nil;
    return [jsonParser objectWithString:locationsString error:&error]; 
}

Here is setUpTableArray:

- (void) setUpTableArray:(NSDictionary *)dict {

    NSArray *array = [dict objectForKey:@"groups"];
    if (array != nil) {
        self.placesArray = array;
    }
}
  • 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-15T20:08:40+00:00Added an answer on May 15, 2026 at 8:08 pm

    Wow, I definitely found my own problem this time. Just get rid of [locationsRequest prepare]; I definitely saw code somewhere that has that, but this tells me otherwise.

    EDIT
    Turns out this was a memory-memory allocation error. Getting rid of that line wasn’t the actual fix. It seems to be some problem with a string being auto-released. I asked a follow up question here.

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

Sidebar

Related Questions

Cocoa newbie here. I am working on an iPhone UITableViewController-based widget that can be
I'm working in Objective C. I have a UITableViewController with about 25 cells that
Working with an undisclosed API, I found a function that can set the number
Working with Reporting Services 2008 r2. So here's my issue: We have 5 reports
I am working on an application that consists of a TabBar controller. Within on
i'm having issues on my custom delegate, not sure why is not working.i wan
Im working off the seismic xml iphone example. In that example there is simply
I'm running the following snippet of code (in ViewDidLoad method of a UITableViewController) to
I do not manage to have iAd working in storyboard, within a UITableViewController. This
I am working on an iPad app that has a main view (In this

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.