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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T08:24:10+00:00 2026-06-13T08:24:10+00:00

Frankly, it is rather a detail question. Apples documentation of NSMutableDictionary https://developer.apple.com/library/mac/#documentation/Cocoa/Reference/Foundation/Classes/NSMutableDictionary_Class/Reference/Reference.html states: setObject:forKey:

  • 0

Frankly, it is rather a detail question.
Apples documentation of NSMutableDictionary https://developer.apple.com/library/mac/#documentation/Cocoa/Reference/Foundation/Classes/NSMutableDictionary_Class/Reference/Reference.html states:

setObject:forKey:
Adds a given key-value pair to the dictionary.
- (void)setObject:(id)anObject forKey:(id)aKey

According to that the parameter forKey accepts any object. However, when I try to pass an NSNumber Incompatible pointer types sending 'NSNumber *' to parameter of type 'NSString *'
Aparently some NSString only is accepted as key.

For the time beeing I will convert my number to a string. In the end it is just a key. But does anybody know who is right? The documentation or the compiler?

  • 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-13T08:24:11+00:00Added an answer on June 13, 2026 at 8:24 am

    You shouldn’t get that warning when using setObject:forKey:. However, you will get that warning when using the similarly-named setValue:forKey:. The latter, while it appears similar in name, is part of the key-value coding system and thus only accepts an NSString as the key.

    Here’s a sample program to demonstrate the difference.

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

Sidebar

Related Questions

This is a pretty stale question but frankly I'm yet to find it answered
This is my first question here on StackOverflow, and quite frankly I'm fairly new
I frankly haven't got a clue what to search for reagarding my question, so
I'm sorry for the title; frankly speaking, I don't even know whether my question
Frankly, I'm flummoxed. Can anyone tell me why I would get a failure message
I haven't programmed in Delphi for a while and frankly didn't think I'll ever
I'm trying to dive into the quite frankly terrible world of unit testing using
I want to create a separate thread that runs its own window. Frankly, the
I know what AJAX stands for. I know javascript passably well. But frankly I'm
I am writing a rather large JavaScript software. I need to trace calls, log

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.