NSString(HBAdditions) Category Reference

Declared in NSString+HBAdditions.h

Overview

NSString (HBAdditions) is a class category in Cephei that provides some convenience methods.

– hb_stringByEncodingQueryPercentEscapes

Returns a string encoded for an HTTP query parameter.

- (NSString *)hb_stringByEncodingQueryPercentEscapes

Return Value

A string encoded for an HTTP query parameter.

Discussion

This method encodes a variety of symbols that can conflict with other portions of a URL, such as & and =, and other similar symbols that could otherwise be misinterpreted by some implementations.

Declared In

NSString+HBAdditions.h

– hb_stringByDecodingQueryPercentEscapes

Returns a string decoded from an HTTP query parameter.

- (NSString *)hb_stringByDecodingQueryPercentEscapes

Return Value

A string decoded from an HTTP query parameter.

Discussion

This method decodes percent escapes, as well as spaces encoded with a +.

Declared In

NSString+HBAdditions.h

– hb_queryStringComponents

Returns a dictionary containing the HTTP query parameters in the string.

- (NSDictionary *)hb_queryStringComponents

Return Value

An NSDictionary object containing the keys and values from the query string.

Discussion

The string is expected to be in the format key=value&key=value, with both keys and values encoded where necessary.

Declared In

NSString+HBAdditions.h