iOS SDK是否提供队列和堆栈? [英] Does the iOS SDK provide queues and stacks?

查看:109
本文介绍了iOS SDK是否提供队列和堆栈?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在编写一个iPhone应用程序,我很惊讶Apple中似乎没有NSQueue或NSStack类基础框架。我看,这将是很容易推出自己的,开始用的 NSMutableArray ,所以我会这样做,除非我错过了什么。我错过了什么吗?

I'm writing an iPhone app, and I'm surprised that there seem to be no NSQueue or NSStack classes in Apple's Foundation Framework. I see that it would be quite easy to roll my own, starting with an NSMutableArray, so I'll do that unless I've missed something. Have I missed something?

推荐答案

据我所知,没有通用类avaialbe。尝试使用NSMutableArray,通过addObject添加并通过objectAtIndex和removeObjectAtIndex获取第一个/最后一个。

as far as I know there is no generic class avaialbe. Try using the NSMutableArray, add via addObject and get first/last via objectAtIndex and removeObjectAtIndex.

这篇关于iOS SDK是否提供队列和堆栈?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆