Inherits from NSObject
Declared in OIAddress.h
OIAddress.m

Overview

Class contain informations about address (user/restaurant).

Tasks

Properties

address1

The street address.

@property (nonatomic, readwrite, copy) NSString *address1

Discussion

The street address.

Declared In

OIAddress.h

address2

The 2nd line of the address (optional).

@property (nonatomic, readwrite, copy) NSString *address2

Discussion

The 2nd line of the address (optional).

Declared In

OIAddress.h

city

The city.

@property (nonatomic, readwrite, copy) NSString *city

Discussion

The city.

Declared In

OIAddress.h

nickname

The nickname of this address (i.e. Home, Work).

@property (nonatomic, readwrite, copy) NSString *nickname

Discussion

The nickname of this address (i.e. Home, Work).

Declared In

OIAddress.h

phoneNumber

The phone number.

@property (nonatomic, readwrite, copy) NSString *phoneNumber

Discussion

The phone number.

Declared In

OIAddress.h

postalCode

The zip code.

@property (nonatomic, readwrite, retain) NSNumber *postalCode

Discussion

The zip code.

Declared In

OIAddress.h

state

The state.

@property (nonatomic, readwrite, copy) NSString *state

Discussion

The state.

Declared In

OIAddress.h

userId

User id is set only if address owner is user not restaurant.

@property (nonatomic, readwrite, copy) NSString *userId

Discussion

User id is set only if address owner is user not restaurant.

Declared In

OIAddress.h

Class Methods

addAddress:usingBlock:

Add user address.

+ (void)addAddress:(OIAddress *)address usingBlock:(void ( ^ ) ( NSError *error ))block

Parameters

address

New address (OIAddress), which will be saved.

block

Block return nil if request finished successfully.

Discussion

Add user address.

Declared In

OIAddress.h

addressWithStreet:city:postalCode:

Created simple address (OIAddress).

+ (OIAddress *)addressWithStreet:(NSString *)street city:(NSString *)city postalCode:(NSNumber *)postalCode

Parameters

street

The street name.

city

The city.

postalCode

The zip code.

Return Value

Return instance of OIAddress.

Discussion

Created simple address (OIAddress).

Declared In

OIAddress.h

deleteAddressByNickname:usingBlock:

Delete user address by its nickname.

+ (void)deleteAddressByNickname:(NSString *)nickname usingBlock:(void ( ^ ) ( NSError *error ))block

Parameters

nickname

The nick name of the address, which will be deleted.

block

If request finished successfully return nil else some error (NSError).

Discussion

Delete user address by its nickname.

Declared In

OIAddress.h

loadAddressByNickname:usingBlock:

Load user address by its nickname. Call block with created OIAddress instance if succeeded.

+ (void)loadAddressByNickname:(NSString *)nickname usingBlock:(void ( ^ ) ( OIAddress *address ))block

Parameters

nickname

The nickname of the searching address(i.e. Home, Work).

block

Return address (OIAddress) specified by nickname.

Discussion

Load user address by its nickname. Call block with created OIAddress instance if succeeded.

Declared In

OIAddress.h

loadAddressesUsingBlock:

Load all user addresses into the OIUser instance.

+ (void)loadAddressesUsingBlock:(void ( ^ ) ( NSMutableArray *addresses ))block

Parameters

block

Block return array of addresses.

Discussion

Load all user addresses into the OIUser instance.

Declared In

OIAddress.h

Instance Methods

addressAsString

This method return address as a string.

- (NSString *)addressAsString

Return Value

Return string, which contain postal code, street and city name.

Discussion

This method return address as a string.

Declared In

OIAddress.h

updateAddressWithAddress:usingBlock:

Update adrress, you must have set a delegate (if not your address will be changed only on the server side).

- (void)updateAddressWithAddress:(OIAddress *)address usingBlock:(void ( ^ ) ( NSError *error ))block

Parameters

address

Changed address, which will replace previous address (OIAddress).

block

Block return nil if request finished successfully.

Discussion

Update adrress, you must have set a delegate (if not your address will be changed only on the server side).

Declared In

OIAddress.h