Click here to support Nimbus development and make a donation at www.pledgie.com !
An iOS framework whose growth is bounded by O(documentation).
Non-Empty Collection Testing

Overview

For testing whether a collection is of a certain type and is non-empty.

Simply calling -count on an object may not yield the expected results when enumerating it if certain assumptions are also made about the object's type. For example, if a JSON response returns a dictionary when you expected an array, casting the result to an NSArray and calling count will yield a positive value, but objectAtIndex: will crash the application. These methods provide a safer check for non-emptiness of collections.

Functions

BOOL NIIsArrayWithObjects (id object)
BOOL NIIsSetWithObjects (id object)
BOOL NIIsStringWithAnyText (id object)

Function Documentation

NIIsArrayWithObjects ( id  object)

Tests if an object is a non-nil array which is not empty.

  • [test] nil.
  • [test] Empty array.
  • [test] Non-array.
  • [test] Array with any objects.

Definition at line 23 of file NINonEmptyCollectionTesting.m.

BOOL NIIsSetWithObjects ( id  object)

Tests if an object is a non-nil set which is not empty.

Definition at line 29 of file NINonEmptyCollectionTesting.m.

BOOL NIIsStringWithAnyText ( id  object)

Tests if an object is a non-nil string which is not empty.

Definition at line 35 of file NINonEmptyCollectionTesting.m.

Generated for Nimbus by doxygen 1.7.4-20110629