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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T20:18:30+00:00 2026-06-09T20:18:30+00:00

I initialize this NSMutableDictionary : define TAREFA @TAREFA define DATA_ITEM @DATA define HORA_ITEM @HORAS

  • 0

I initialize this NSMutableDictionary:

define TAREFA      @"TAREFA"  
define DATA_ITEM        @"DATA"   
define HORA_ITEM        @"HORAS"  
define ID          @"ID"  
define STATE       @"NA"  
define APROVED     @"APROVED"  
define REJECTED    @"REJECTED" 

    itensArray = [[NSMutableArray alloc] init];

    for (int i=0; i< [listagens size]; i++)
    {   
        NSMutableDictionary *tmpDictionary = [[NSMutableDictionary alloc] initWithObjectsAndKeys:
                                        [[listagens item:i] WI_ID], ID,
                                        [[listagens item:i] WI_TEXT], TAREFA,
                                        [[listagens item:i] WI_CD], DATA_ITEM,                                            
                                        [[listagens item:i] WI_CT], HORA_ITEM,                                                                                     
                                        STATE, STATE,
                                        nil];

        [itensArray addObject:tmpDictionary];           
    }

Later on, i do the following:

    for (int i=0; i<[itensArray count]; i++) 
    {
        if ([[[itensArray objectAtIndex:i] objectForKey:ID] isEqualToString:cell.idLabel.text]) {
            [[itensArray objectAtIndex:i] setString:APROVED forKey:STATE];
            break;
        }
    }

I initialize the array, then later on, i change a string of the NSMutableDictionary. When i set the value i get the following runtime error:

‘NSInvalidArgumentException’, reason: ‘-[__NSCFDictionary
setString:forKey:]: unrecognized selector sent to instance 0x7b7d170’

It appears i´m not changing the value correctly. Is it a syntax error? How is it done?

  • 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-09T20:18:31+00:00Added an answer on June 9, 2026 at 8:18 pm

    maybe you misspelled the name of the method.

    // WRONG
    [[itensArray objectAtIndex:i] setString:APROVED forKey:STATE];
    
    // GOOD
    [[itensArray objectAtIndex:i] setValue:APROVED forKey:STATE];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this class: public MyClass { public void initialize(Collection<String> data) { this.data =
+ (id) newWithNode:(CXMLNode*)node { return (id)[[[NSMutableDictionary alloc] initWithNode:node]autorelease]; } In this code MutableDictionary is
Suppose I have a class with a string instance attribute. Should I initialize this
I have a struct that I initialize like this: typedef struct { word w;
The three initialize methods of this class are very, very, very similar. I'd like
When I use the this method to initialize a UITabBarItem : - (id)initWithTitle:(NSString *)title
What is wrong with this Anonymous Object Initialize syntax? If (Not row Is Nothing)
Can we initialize Python objects with statement like this: a = b = c
Is this: ByteBuffer buf = ByteBuffer.allocate(1000); ...the only way to initialize a ByteBuffer ?
I'm trying to initialize string with iterators and something like this works: ifstream fin(tmp.txt);

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.