how to compare an adjacent array element that contains date. The thing is when i compare
BOOL day = [[temp_date objectAtIndex:k] compare:[temp_date objectAtIndex:k+1]];
it throughs the following expection
* Terminating app due to uncaught exc开发者_如何学Goeption 'NSRangeException', reason: '* -[NSCFArray objectAtIndex:]: index (23) beyond bounds (23)'
thanks in advance
Regards, sathish
It seems you do everything correct, just check that you're always within array's bounds. If you do that in a loop the condition may be:
for (int k = 0; k+1 <temp_date.count; ++k)
...
精彩评论