• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Integer as key in NSMutableDictionary
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Integer as key in NSMutableDictionary


  • Subject: Integer as key in NSMutableDictionary
  • From: Weydson Lima <email@hidden>
  • Date: Mon, 4 May 2009 02:22:30 -0500

Hi,

Assume that:

	NSMutableDictionary *result = [[NSMutableDictionary alloc]
initWithCapacity:10];
        NSInteger ID;

And I add objects to the dictionary:

		[result setObject:[NSArray arrayWithObjects: {... objects ...}
						   nil]

				   forKey:ID];

I am getting warnings when adding integers in the array and assigning
the integer ID as a key. The code does work though, but I am guessing
there is a better way to accomplish what I want. I know that these
methods are expecting pointers as parameters and I am passing a
scalar. So, what's the best way to approach that?

Thank you
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Integer as key in NSMutableDictionary
      • From: Martin Wierschin <email@hidden>
    • Re: Integer as key in NSMutableDictionary
      • From: Ken Thomases <email@hidden>
    • Re: Integer as key in NSMutableDictionary
      • From: Alexander Heinz <email@hidden>
    • Re: Integer as key in NSMutableDictionary
      • From: Nick Zitzmann <email@hidden>
    • Re: Integer as key in NSMutableDictionary
      • From: Jason Foreman <email@hidden>
  • Prev by Date: Creating a NSHTTPCookie
  • Next by Date: How to change the case of letters
  • Previous by thread: Creating a NSHTTPCookie
  • Next by thread: Re: Integer as key in NSMutableDictionary
  • Index(es):
    • Date
    • Thread