• 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
Can an NSArray ever have a count of -1?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Can an NSArray ever have a count of -1?


  • Subject: Can an NSArray ever have a count of -1?
  • From: Jim Adams <email@hidden>
  • Date: Fri, 19 Feb 2016 21:17:36 +0000
  • Thread-topic: Can an NSArray ever have a count of -1?

I have code that looks like the following:

NSArray *sortedEvents = [events.eventSet sortedArrayUsingDescriptors:[NSArray arrayWithObject:[NSSortDescriptor sortDescriptorWithKey:@"date" ascending:YES]]];
            int64_t csi = -1LL;

            SLogInfo(@"Starting csi %ld count %d", csi, sortedEvents.count);

In the console I see:
INFO: Starting csi -1 count -1
The very next line crashes when the sortedEvents are accessed. What could cause the array to have a -1 count?


Note that I am seeing this in a release build so debugging is very difficult.
_______________________________________________

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: Can an NSArray ever have a count of -1?
      • From: Sandor Szatmari <email@hidden>
    • Re: Can an NSArray ever have a count of -1?
      • From: Jens Alfke <email@hidden>
  • Prev by Date: Re: Breakpoints: Swift Error
  • Next by Date: Re: Can an NSArray ever have a count of -1?
  • Previous by thread: Re: Breakpoints: Swift Error
  • Next by thread: Re: Can an NSArray ever have a count of -1?
  • Index(es):
    • Date
    • Thread