Can an NSArray ever have a count of -1?
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