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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T10:47:39+00:00 2026-05-29T10:47:39+00:00

I am having a really weird problem because i get completely different results between

  • 0

I am having a really weird problem because i get completely different results between testing my program WHILE connected to the computer (trough xcode) but ON my device. and just taping the icon while not being plugged to xcode. (I think it might be coordinate issues).

So i was thinking there might be a difference between testing in these 2 ways.

Sorry i forgot to specify, I used to get the same results in both ways but then i created a singleton for my location manager instead of creating a single location manager object in each window.

This is how i am creating the Header:

#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
#import <CoreLocation/CoreLocation.h>

// protocol for sending location updates to another view controller
@protocol LocationManagerDelegate <NSObject>
@required
- (void)locationUpdate:(CLLocation*)location;
@end

@interface LocationManagerSingleton : NSObject <CLLocationManagerDelegate> {

    CLLocationManager* locationManager;
    CLLocation* location;
    //id delegate;
}

@property (nonatomic, retain) CLLocationManager* locationManager;
@property (nonatomic, retain) CLLocation* location;
@property (nonatomic, assign) id <LocationManagerDelegate> delegate;

+ (LocationManagerSingleton*) sharedInstance; // Singleton method

@end

and this is the implementation:

#import "LocationManagerSingleton.h"

//static LocationManagerSingleton* sharedCLDelegate = nil;

@implementation LocationManagerSingleton
@synthesize locationManager, location, delegate;

#pragma mark - Singleton Methods -

+ (LocationManagerSingleton*)sharedInstance {

    static LocationManagerSingleton *_sharedInstance;
    if(!_sharedInstance) {
        static dispatch_once_t oncePredicate;
        dispatch_once(&oncePredicate, ^{
            _sharedInstance = [[super allocWithZone:nil] init];
            });
        }

        return _sharedInstance;
}



+ (id)allocWithZone:(NSZone *)zone {    

    return [self sharedInstance];
}


- (id)copyWithZone:(NSZone *)zone {
    return self;    
}

#if (!__has_feature(objc_arc))

- (id)retain {  

    return self;    
}

- (unsigned)retainCount {
    return UINT_MAX;  //denotes an object that cannot be released
}

- (void)release {
    //do nothing
}

- (id)autorelease {

    return self;    
}
#endif

#pragma mark - Custom Methods -

// Add your custom methods here
- (id)init
{
    self = [super init];
    if (self != nil) {
        self.locationManager = [[CLLocationManager alloc] init];
        self.locationManager.delegate = self;
        self.locationManager.desiredAccuracy = kCLLocationAccuracyBestForNavigation;
        self.locationManager.distanceFilter = 5;
        self.locationManager.purpose = @"This app uses your location for Augmented Reality";
        [self.locationManager startUpdatingLocation];
        [self.locationManager startUpdatingHeading];

        NSLog(@"LocationManager initialized with accuracy best for Navigation");
        NSLog(@"CUrrent Latitude: %f, Current Longitude: %f",locationManager.location.coordinate.latitude,locationManager.location.coordinate.longitude);
    }
    return self;
}

#pragma mark - CLLocationManagerDelegate Methods -
- (void)locationManager:(CLLocationManager*)manager
    didUpdateToLocation:(CLLocation*)newLocation
           fromLocation:(CLLocation*)oldLocation
{
    /*…some filer method to check if the new location is good …*/
    bool good = YES;
    if (good)
    {
        [self.delegate locationUpdate:newLocation];
    }
    //self.location = newLocation;
    //NSLog(@"Updated: %@",newLocation);    
}


- (void)locationManager:(CLLocationManager*)manager
       didFailWithError:(NSError*)error
{
    /* ... */

}


@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-29T10:47:40+00:00Added an answer on May 29, 2026 at 10:47 am

    Okay it seems that OpenGL was causing the problem. My theory was that since a pointer variable used for texturing was inside a loop when the localization manager updated and redraw this variable would get messed up because it was being reinitialized everyrun but the value wouldnt be set to 0, and since opengl has the pointer to the adress not to the pointer it would read corrupted data (since the loop might have updated that space until opengl was told the new adress of the variable). Still i have no idea why it worked perfectly while hooked up to the computer and not by itself.

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

Sidebar

Related Questions

This is a really weird problem that I have been having. When I download
Having a really aggravating problem using Managed Metadata in SP2010 where I can get
Having some really weird problem and as beginner with c++ I don't know why.
I am having a really really weird problem with visual studio 2008 and the
I am having a weird problem here, and I am really stuck, need to
I am having really weird problem: Fatal error: Allowed memory size of 134217728 bytes
I'm having a really weird problem with the iPad app I'm writing. On startup
I'm having a really really weird problem with a web app I'm programming. Basically,
I am having a weird problem here, and I am really stuck, need to
I'm really having a problem finding out how to fix this. I cannot seem

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.