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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T01:12:42+00:00 2026-05-26T01:12:42+00:00

Inside my Table view controller I have following method -(BOOL)isValidCoordinate:(CLLocationCoordinate2D)coordinate { //This is just

  • 0

Inside my Table view controller I have following method

-(BOOL)isValidCoordinate:(CLLocationCoordinate2D)coordinate
{
   //This is just to make sure exception is always thrown a cut down version of method
    [NSException raise:@"Invalid longitude value" format:@"Longitude of %d is invalid", coordinate.longitude]; 
    return TRUE;
}

I am running a unit test against it and I it failing giving following exception

2011-10-04 22:58:43.380 navman2[74159:ec03] -[MapViewController isValidCoordinate:]: unrecognized selector sent to instance 0x5e20830
2011-10-04 22:58:43.382 navman2[74159:ec03] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[MapViewController isValidCoordinate:]: unrecognized selector sent to instance 0x5e20830'
*** Call stack at first throw:
(
    0   CoreFoundation                      0x00f555a9 __exceptionPreprocess + 185
    1   libobjc.A.dylib                     0x010a9313 objc_exception_throw + 44
    2   CoreFoundation                      0x00f570bb -[NSObject(NSObject) doesNotRecognizeSelector:] + 187
    3   CoreFoundation                      0x00ec6966 ___forwarding___ + 966
    4   CoreFoundation                      0x00ec6522 _CF_forwarding_prep_0 + 50
    5   navman2Tests                        0x05765b41 -[navman2Tests testExceptionThrownBycoordinatesCheck] + 193
    6   CoreFoundation                      0x00ec5c7d __invoking___ + 29
    7   CoreFoundation                      0x00ec5b51 -[NSInvocation invoke] + 145
    8   SenTestingKit                       0x201043d2 -[SenTestCase invokeTest] + 69
    9   SenTestingKit                       0x20104aa7 -[SenTestCase performTest:] + 192
    10  SenTestingKit                       0x201041d3 -[SenTest run] + 88
    11  SenTestingKit                       0x20106eda -[SenTestSuite performTest:] + 115
    12  SenTestingKit                       0x201041d3 -[SenTest run] + 88
    13  SenTestingKit                       0x20106eda -[SenTestSuite performTest:] + 115
    14  SenTestingKit                       0x201041d3 -[SenTest run] + 88
    15  SenTestingKit                       0x20106eda -[SenTestSuite performTest:] + 115
    16  SenTestingKit                       0x201041d3 -[SenTest run] + 88
    17  SenTestingKit                       0x201067a4 +[SenTestProbe runTests:] + 174
    18  Foundation                          0x0092e79e __NSFireDelayedPerform + 441
    19  CoreFoundation                      0x00f368c3 __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__ + 19
    20  CoreFoundation                      0x00f37e74 __CFRunLoopDoTimer + 1220
    21  CoreFoundation                      0x00e942c9 __CFRunLoopRun + 1817
    22  CoreFoundation                      0x00e93840 CFRunLoopRunSpecific + 208
    23  CoreFoundation                      0x00e93761 CFRunLoopRunInMode + 97
    24  GraphicsServices                    0x016171c4 GSEventRunModal + 217
    25  GraphicsServices                    0x01617289 GSEventRun + 115
    26  UIKit                               0x001b5c93 UIApplicationMain + 1160
    27  navman2                             0x000028b9 main + 121
    28  navman2                             0x00002835 start + 53
)
terminate called throwing an exception(gdb) 

Unit test is following:

#import "navman2Tests.h"
#import "TableViewController.h"
#import "MapViewController.h"


@implementation navman2Tests

- (void)setUp
{
    [super setUp];

    // Set-up czode here.
}

- (void)tearDown
{
    // Tear-down code here.

    [super tearDown];
}


- (void) testExceptionThrownBycoordinatesCheck
{

    TableViewController *newView2 =[[MapViewController alloc] init];
    CLLocationCoordinate2D coordinate;
    double lat = 61.2180556;
    double lng = -149.9002778;
    coordinate.latitude = lat;
    coordinate.longitude = lng;
    STAssertThrows([newView2 isValidCoordinate:coordinate],@"some text description");
    [newView2 release];
}
@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-05-26T01:12:43+00:00Added an answer on May 26, 2026 at 1:12 am

    The error is that you did declare newView2 as a TableViewController not a MapViewController (which has that method), change:

    TableViewController *newView2 =[[MapViewController alloc] init];
    

    with:

    MapViewController *newView2 =[[MapViewController alloc] init];
    

    anyway I would call the variable newViewController rather than newView2 😛

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

Sidebar

Related Questions

I have a table view which is inside a navigation controller, however besides this
i have this MainViewController, which is a controller for my table view. Whenever I
I have a view controller, which creates 2 view controllers inside it. Inside each
I am using navigation controller and have table views inside views. when i select
I'm writing an iOS app with a table view inside a tab view. In
I have table inside a div tab. The table has 40 rows in it
I have a span element inside a table td element. The span tag has
I have a small form inside a table. POSTing that form creates a new
I have a span and an anchor inside a table cell. I have the
I have a drop down box for each row inside a table <table> <tr>

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.