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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T20:37:52+00:00 2026-05-30T20:37:52+00:00

on the init i have : dict = [[NSMutableDictionary alloc] init]; //dict is NSMutableDictionary

  • 0

on the init i have :

 dict = [[NSMutableDictionary alloc] init]; //dict is NSMutableDictionary

then i am adding him numbers:

[dict setObject:@"SPOT1" forKey:[NSNumber numberWithInt:array[0] ]] ;
[dict setObject:@"SPOT2" forKey:[NSNumber numberWithInt:array[1] ]] ;
[dict setObject:@"SPOT3" forKey:[NSNumber numberWithInt:array[2] ]] ;
[dict setObject:@"SPOT4" forKey:[NSNumber numberWithInt:array[3] ]] ;
[dict setObject:@"SPOT5" forKey:[NSNumber numberWithInt:array[4] ]] ;

NSLog(@"dictionary:%@",dict);

the array[] has a GOOD values.
the NSLog print only the last spot5.(the rest of them lost)
and if am trying to send that dict (with this 1 value), with NSNotificationCenter i got it as null !
so it some how released.

why?

edit for the NSNotificationCenter :

[[NSNotificationCenter defaultCenter] postNotificationName:@"DigitalArrived" object:nil userInfo:dict];//post

[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(getSensorsData:) name:@"DigitalArrived" object:nil]; //get

thanks a lot.

  • 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-30T20:37:53+00:00Added an answer on May 30, 2026 at 8:37 pm

    Might be array elements are all same. Pl. check that. If all are same, then value for the key will be replaced in the NSDictionary instead of adding new pair.

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

Sidebar

Related Questions

My persons class allows a person to have a dict of numbers pointing to
If I have something like this: SomeObject *obj = [[SomeObject alloc] init]; obj.someIvar =
I have an init method that takes an (id) argument: -(id) initWithObject:(id) obj; I'm
I have several init.d scripts that I'm using to start some daemons. Most of
I have a class: function RustEditor() { this.init = function() { var saveButton =
I have often seen an init() within the constructor of AS3 classes, sometimes even
I have a git-cpan-init of a repo which yielded a different root node from
I have been trying to make an init script using start-stop-daemon. I am stuck
I have a TableView that builds and draws ok, but then crashes on scrolling
I want to have dict / list to which I can add values, just

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.