Latest 0.0.1
Homepage https://github.com/apploft/NSArray-SafeAccess
License MIT
Platforms ios , requires ARC
Authors

When accessing an item from a NSArray object with an index out of the bounds of the NSArray, nil is returned instead of throwing a NSRangeException.

Installation

Install via cocoapods by adding this to your Podfile:

pod "NSArray+SafeAccess", "~> 0.0.1"

Usage

Import header file:

#import "NSArray+SafeAccess.h"

Access items of a NSArray object:

NSArray *myArray = @[@"A", @"B", @"C"];
NSString *myString = [myArray objectAtIndexOrNil:3]; // returns nil

Latest podspec

{
    "name": "NSArray+SafeAccess",
    "version": "0.0.1",
    "summary": "NSArray category for avoiding NSRangeException",
    "description": "                   When accessing an item from a NSArray object with an index out of the bounds of the NSArray, nil is returned instead of throwing a NSRangeException.n",
    "homepage": "https://github.com/apploft/NSArray-SafeAccess",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "Michael Kamphausen": "[email protected]"
    },
    "platforms": {
        "ios": null
    },
    "source": {
        "git": "https://github.com/apploft/NSArray-SafeAccess.git",
        "tag": "0.0.1"
    },
    "source_files": [
        "Classes",
        "Classes/**/*.{h,m}"
    ],
    "exclude_files": "Classes/Exclude",
    "requires_arc": true
}

Pin It on Pinterest

Share This