• 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
Array sorting problem
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Array sorting problem


  • Subject: Array sorting problem
  • From: Matt Ridley <email@hidden>
  • Date: Thu, 10 May 2001 19:16:35 +0100

Hi folks,

I have an NSMutableDictionary called "items". I'm trying to create an array of its keys (which are just NSStrings), sorted alphabetically. My code works fine, but produces a warning during compilation:

assignment from incompatible pointer type

The relevant part of my code is as follows:


NSMutableArray *tempArray;
tempArray = [[items allKeys] sortedArrayUsingSelector:@selector(compare:)];


The second line is the one highlighted when I click the warning message in Project Builder. As I said, it works perfectly, but I'd like to understand the cause of the warning. Can anyone help?


Best,
-Matt

--
Matt Ridley
<http://www.mattridley.com/>


  • Follow-Ups:
    • Re: Array sorting problem
      • From: Arno Gourdol <email@hidden>
  • Prev by Date: NSButton with an image
  • Next by Date: Re: Array sorting problem
  • Previous by thread: Re: NSButton with an image
  • Next by thread: Re: Array sorting problem
  • Index(es):
    • Date
    • Thread