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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T18:47:05+00:00 2026-06-16T18:47:05+00:00

My NSMutableDictionary contains simple keys (@one, @two, @three) and complex keys (@com.alpha, @com.beta). Is

  • 0

My NSMutableDictionary contains simple keys (@”one”, @”two”, @”three”) and complex keys (@”com.alpha”, @”com.beta”). Is it possible to use observers for a complex key?

Observers work well with simple keys, but didn’t worked with complex keys. What is a solution?

[self.dict addObserver:self forKeyPath:@"com.alpha" options:NSKeyValueObservingOptionOld | NSKeyValueObservingOptionNew context:nil];

-(IBAction) onChange:(id)sender
{
 [self.dict setObject:@"newValue" forKey:@"com.alpha"];
}

-(void) observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context
{
  NSLog(@"____ value had changed");
}
  • 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-16T18:47:07+00:00Added an answer on June 16, 2026 at 6:47 pm

    You cannot use keys containing a dot . with key-value-coding or key-value-observing. The dot is used to build a key path that is used to specify a sequence of object properties to traverse. (See Keys and Key Paths in the “Key-Value Coding Programming Guide”.)

    For example,

    id x = [object valueForKeyPath:@"com.alpha"];
    

    is the same as

    id x = [[object valueForKey:@"com"] valueForKey:@"alpha"];
    

    For a single key “com.alpha”, you will have to rename it to e.g. “com_alpha”.

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

Sidebar

Related Questions

Possible Duplicate: How to check if an NSDictionary or NSMutableDictionary contains a key? I
I have one NSMutableDictionary and it contains the user details. I have used parsing
I'm having issues with a singleton I've created. It contains two NSMutableDictionary's, which are
I have built one 'deep' NSMutableDictionary that contains parsed XML data along with other
I have a main NSMutableDictionary that contains a collection of others NSMutableDictionary. The thing
After adding the key value pairs in NSMutableDictionary, when i retrive the key/values from
I have a NSMutableArray with objects of type NSMutableDictionary , the NSMutableDictionary contains 2
I have a JSON returned NSMutabledictionary that contains the following OdometerStart = 9 miles;
In the following code I want to traverse an NSMutableArray (self.codes) which contains NSMutableDictionary
I have a NSMutableArray which contains some NSMutableDictionary object type. In some situations I

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.