• 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
structs in Mutable containers
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

structs in Mutable containers


  • Subject: structs in Mutable containers
  • From: "Christian Giordano" <email@hidden>
  • Date: Tue, 16 Sep 2008 10:18:16 +0100

Hi guys, I'm finding myself trying to add to mutable containers like
NSMutableDictionary or NSMutableArray instead of NSObjects subclasses,
just structs. For instance in a NSMutableDictionary the key was an
integer defined with #define. In this case I sort it with:

... forKey:[[NSNumber alloc] initWithInt:BAND_RED]];

Not a really elegant solution but I can understand that those
containers require pointers.

Now I need to create a NSMutableArray of CGPoint, how can I make it
became a pointer?

... addObject:CGPointMake(x,y)];

returns indeed "error: incopatible type for argument 1 of 'addObject:'

Is there a more elegant way to use structs as key or as mutable
container's items?


Thanks a lot, chr
_______________________________________________

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: structs in Mutable containers
      • From: Graham Cox <email@hidden>
    • Re: structs in Mutable containers
      • From: Phil <email@hidden>
  • Prev by Date: Re: Outlet from Different Implementation?
  • Next by Date: Re: structs in Mutable containers
  • Previous by thread: Re: Does NSTextField sends delegate messages to itself?
  • Next by thread: Re: structs in Mutable containers
  • Index(es):
    • Date
    • Thread