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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T11:40:29+00:00 2026-05-27T11:40:29+00:00

The alerts appear for a split-second or did not show when application launches in

  • 0

The alerts appear for a split-second or did not show when application launches in project with ARC (without using ARC all it’s OK). (I add CoreLocation framework and I import it to project).

My code:

#import <CoreLocation/CoreLocation.h>

    - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions{ 

    CLLocationCoordinate2D coordinate;
    CLLocationManager *locationManager = [[CLLocationManager alloc] init];
    NSLog(@"jestem po okienku ");

    if (locationManager.locationServicesEnabled == NO) 
    {
        coordinate.latitude = 0.0;
        coordinate.longitude = 0.0;
    }
    else
    {     
        locationManager.desiredAccuracy = kCLLocationAccuracyBest;
        [locationManager startUpdatingLocation];
        CLLocation *location = [locationManager location];
        if (!location) {
            coordinate.latitude = 0.0;
            coordinate.longitude = 0.0;
        }
        // Configure the new event with information from the location.
        coordinate = [location coordinate];
    }
    return YES; }
  • 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-27T11:40:30+00:00Added an answer on May 27, 2026 at 11:40 am

    You are storing the location manager pointer in a local variable. So ARC is free to release that location manager before returning from this method.

    If you wish to keep that location manager alive for longer you need to keep a longer term strong reference to it. Like an ivar or property.

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

Sidebar

Related Questions

I have an application in which I have to show the alerts for user
The following code is throwing two alerts as expected in IE but not in
I have an application that reads a database and outputs alerts to any dependencies
I have been using win32api.MessageBox to do alerts, and this works for apps running
I'm trying to make a notification area that will show alerts. return this.each(function() {
I am using a simple jQuery plugin to style my javascript alerts. The problem
Xcode4 introduced the gray-rounded-square style non-modal alerts that momentarily appear as required. For an
I am creating an application that is essentially a financial alerts site. I am
The following source code alerts the following results: Internet Explorer 7 : 29 Firefox
What SQL Server Alerts do you always setup for every database? What do you

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.