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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T12:01:34+00:00 2026-05-27T12:01:34+00:00

I am watching a somewhat cruel behaviour momentarily: I have a ViewController for building

  • 0

I am watching a somewhat cruel behaviour momentarily: I have a ViewController for building a View programmatically. For this purpose I have stored the names of the UILabels that will be displayed in a NSDictionary that is held in an external class which is a singleton.
Unfortunately the NSDictionary is not accessible if I want to use the values in loadView. So I made some tests: The NSDictionary and its contents are availbale in init and the class is, of course, NSCFDictionary. If I have a look at it in loadView the class sometimes is NSCFDictionary and sometimes also CALayer or NSString?! I absolutely don’t know what is happening??? This is the code I use:

- (id) init
{
    self = [super initWithNibName:nil bundle:nil];    
    if (self)
    {
        UITabBarItem *tbi = [self tabBarItem];
        [tbi setTitle:@"xxx"];
    }

    NSEnumerator *num = [[[ValueDispatcher dispatcher] labelDic] keyEnumerator];
    NSLog(@"Class(init): %@", [[[ValueDispatcher dispatcher] labelDic] class]);
    NSLog(@"No: %i", [[[ValueDispatcher dispatcher] labelDic] count]);
    for (id key in num)
    {
        NSLog(@"Key %@  Value  %@", key, [[[ValueDispatcher dispatcher] labelDic] valueForKey:key]);
    }

       return self;
    }  

- (void)loadView 
{
    NSLog(@"Class(loadview)1: %@", [[[ValueDispatcher dispatcher] labelDic] class]);
    NSLog(@"No: %i", [[[ValueDispatcher dispatcher] labelDic] count]);
    NSEnumerator *num = [[[ValueDispatcher dispatcher] labelDic] keyEnumerator];
    for (id key in num)
    {
        NSLog(@"Key34 %@  Value  %@", key, [[[ValueDispatcher dispatcher] labelDic] valueForKey:key]);
    }
...

At which point between init and loadView can or will a NSDictionary be changed?
Btw, another info that might be important: If I use the above code and the NSDictionary is filled by an external service everything works fine. But if I fill the NSDictionary from a stored plist during startup it fails and I watch the described behaviour…

  • 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-27T12:01:35+00:00Added an answer on May 27, 2026 at 12:01 pm

    If I have a look at it in loadView the class sometimes is NSCFDictionary and sometimes also CALayer or NSString?

    this (typically) means you have a reference count issue or you have not unregistered your observers correctly — assuming you never set the dictionary. run instruments with zombies enabled.

    At which point between init and loadView can or will a NSDictionary be changed?

    a lot can happen in that time beyond the code you posted.

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

Sidebar

Related Questions

I've been watching Douglas Crockford's talks at YUI Theater, and I have a question
I have just finished watching the following videos in an attempt to understand JDO
Recently I have been watching Plural Sight ASP.NET videos on data binding, and I
I have been watching a video of a conference (See: Good JavaScript Habits for
After watching this video , I am wondering if I am using my controllers
After watching RailsCasts #273 I want to use the Geocoder gem. I've seen this:
I have been watching the growing visibility of functional programming languages and features for
I was watching this David's article. http://blogs.msdn.com/b/dphill/archive/2011/01/23/closable-tabbed-views-in-prism.aspx He's using blend interacvity. I want to
I have been watching a tutorial for a game in blender, but when I
After watching the Knockout.JS video with Steve Sanderson I decided this would be great

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.