Jul 18 2011

SBQueue – An Objective-C Queue for iOS 4.3

Published by at 10:18 PM under iPhone



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:

SBQueue Methods

SBQueue 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.

Technorati Tags: , , , , , ,

5 responses so far

5 Responses to “SBQueue – An Objective-C Queue for iOS 4.3”

  1. arden sagt:

    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)
    {

    }

  2. Bill sagt:

    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
    }

  3. Andrew sagt:

    will you leave it for a free download or you have plans to make it paid?