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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T12:18:30+00:00 2026-05-23T12:18:30+00:00

When I trying to launch my app on simulator (3.1.3 , Xcode 3.1.4), it

  • 0

When I trying to launch my app on simulator (3.1.3 , Xcode 3.1.4), it shows me objc_msgSend and application does not launch. This happens only when I alloc NSMUtable Array
This is my code part,
in viewDidLoad,

 -(void)viewDidLoad{

   locationArray = [[NSMutableArray alloc] initWithObjects:@"new delhi", @"faridabad",@"meerut"];
   str1=[locationArray objectAtIndex:0];
   str2=[locationArray objectAtIndex:1];

      [super viewDidLoad];
 } 

Then I want to use locationArray objects in following method;

 -(CLLocationCoordinate2D) addressLocation1{

double latitude = 0.0;
double longitude = 0.0;
NSString *str= [locationArray NSString *str= [locationArray objectAtIndex:0];

    //NSString *str= @"new delhi"

NSString *urlString = [NSString stringWithFormat:@"http://maps.google.com/maps/geo?q=%@&output=csv", 
                       [str stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]];
NSString *locationString = [NSString stringWithContentsOfURL:[NSURL URLWithString:urlString]];
NSArray *listItems = [locationString componentsSeparatedByString:@","];


if([listItems count] >= 4 && [[listItems objectAtIndex:0] isEqualToString:@"200"]) {
    latitude = [[listItems objectAtIndex:2] doubleValue];
    longitude = [[listItems objectAtIndex:3] doubleValue];
}
else {
    //Show error
}

CLLocationCoordinate2D location;
location.latitude = latitude;
location.longitude = longitude;


return location;

   }

problem occur only when alloc the locationArray, whats wrong with me, please help
thanks

  • 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-23T12:18:30+00:00Added an answer on May 23, 2026 at 12:18 pm

    locationArray = [[NSMutableArray alloc] initWithObjects:@"new delhi", @"faridabad",@"meerut"];

    Try

    locationArray = [[NSMutableArray alloc] initWithObjects:@"new delhi", @"faridabad",@"meerut", nil];

    From The NSArray docs you see that for initWithObjects: it requires termination with nil. If you don’t want to do that, and you know how many you have, you can use initWithObjects:count:

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

Sidebar

Related Questions

I'm trying to launch an external program from my java swing app using this:
I'm trying to Launch an application within my App. For example: If I press
I'm trying to install and launch a compiled MonoTouch application on the iPad simulator
I'm trying to launch another process from a service (it's a console app that
I'm trying to launch my ClickOnce application using C# code with HttpWebRequest class. The
I'm trying to launch another application from C# application, is there a way to
Here's the situation: I am trying to launch an application, but the location of
I'm trying to configure the Quick Launch menu to only display the ancestors and
I am trying to run my app in iPhone Simulator, but it crahes on
I am using MacOSX 10.6, and the Xcode simulator is 4.2, but after trying

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.