Jul 18 2011
SBQueue - An Objective-C Queue for iOS 4.3

Because of the missing NSQueue, i have developed my own Queue equivalent. You can download it for free there (click). I have added some Unit Tests to make sure the Queue is working.
Below you can see the List of supported Queue-Methods:
Using it is very simple, just initialize the SBQueue and add Objects to it:
#import "SBQueue.h" SBQueue *queue = [[SBQueue alloc] initWithQueueSize:10]; [queue addObject:[[NSString alloc] initWithString:@"Hello SBQueue"]];
If you have some improvements, feel free to drop a line below.




can i use fast enumeration on this queue?
like
SBQueue *queue = ;
for ( id item in [queue getAllObjects])
{
…
}
how to make fast enumeration available on your queue class as natural?
like
SBQueue *queue = ;
for ( id item in queue)
{
…
}
Thanks for the nice queue class Siegfried.
I’ve added fast enumeration to the class, but unfortunately the reply field on this site keeps stripping out important pieces of the code. If you would like to download it, you can find it at:
https://www.katr.com/code/SBQueueFast.zip
Now you can write:
for ( NSString *str in myQueue ) {
…do something
}
Great work, it is very useful. Thanks!
I have updated my project with your code and added a test for the fast enumeration. It also contains the project-files for JetBrains AppCode 1.x