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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T09:43:23+00:00 2026-06-04T09:43:23+00:00

I’m in the process of porting some iOS3 code over to iOS5. Originally I

  • 0

I’m in the process of porting some iOS3 code over to iOS5. Originally I was using a singleton for a global data store. It was providing a single instance of any data I needed to access across view controllers and was primarily populated with data I pull from a server.

In the iOS3 version I used Matt Gallagher’s singleton implementation for my data store. With iOS5, however, I want to use ARC so I moved to Luke Redpath’s GCD implementation.

Now I’m having trouble with some of the code that pulls server data. In the singleton init function I attempt to populate the singleton by polling my server. Server communication is handled by a separate class. The communication class uses credential data stored in the singleton and this seems to be where I’m running into trouble. Stepping through the code, my server com routine exits when I hit the line of code that accesses the singleton. No error, no warning, the routine just exits when it hits the singleton access line.

The singleton is working correctly in other places so I assume this has something to do with the circular reference to the singleton (singleton instantiates the server class that attempts to access the singleton).

At this point I’m not sure how to proceed. I would rather not restructure my code for the port. Any suggestions on a) what my issue might be and b) other alternatives to create a single, globally accessible, instance of my server data?

EDITED

Using Apple’s singleton design pattern, as suggested by sosborn, causes issues with the following block of code in the init routine of my singleton.

// enable the location controller
locationController = [[LocationController alloc] init];
locationController.delegate = self;
[locationController.locationManager startUpdatingLocation];

On the last line I get an EXC_BAD_ACCESS with

warning: Unable to restore previously selected frame.

I assume this is a memory management issue. Based on Apple’s documentation, I did not override any of the memory management routines.

If you want a singleton instance (created and controlled by the class factory method) but also have the ability to create other instances as needed through allocation and initialization, do not override allocWithZone: and the other methods following it as shown in Listing 2-15.

Did I do this incorrectly?

  • 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-06-04T09:43:25+00:00Added an answer on June 4, 2026 at 9:43 am

    I was never able to fully resolve this issue. I finally decided to refactor the app using newer block-based HTTP request methods.

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

Sidebar

Related Questions

I have thousands of HTML files to process using Groovy/Java and I need to
I have some data like this: 1 2 3 4 5 9 2 6
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have just tried to save a simple *.rtf file with some websites and
For some reason, after submitting a string like this Jack’s Spindle from a text
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I am reading a book about Javascript and jQuery and using one of the
I have this code to decode numeric html entities to the UTF8 equivalent character.
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and

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.