数组中相邻的日期元素
如何比较包含日期的相邻数组元素。问题是当 我
BOOL day = [[temp_date objectAtIndex:k] compare:[temp_date objectAtIndex:k+1]];
通过以下期望
进行比较* 由于未捕获的异常“NSRangeException”而终止应用程序,原因:“* -[NSCFArray objectAtIndex:]:索引(23)超出界限(23)”
提前致谢
问候, 萨蒂什
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 exception 'NSRangeException', reason: '* -[NSCFArray objectAtIndex:]: index (23) beyond bounds (23)'
thanks in advance
Regards,
sathish
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
看来你做的一切都是正确的,只需检查你是否始终在数组的范围内。如果您在循环中执行此操作,则条件可能是:
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: