OIUser Class Reference
Inherits from | NSObject |
Declared in | OIUser.h OIUser.m |
Tasks
Other Methods
-
firstName
First name.
property -
lastName
Last name.
property -
addresses
Array of user addresses.
property -
creditCards
Array of user credit cards.
property -
orders
Array of user orders.
property -
+ accountInfo:password:usingBlockUser:usingBlockError:
Load account information by user email and password.
-
+ createNewAccount:email:password:usingBlock:
Create new account for OIUser instance. Call block with nil parameter if succeeded or with a request error if failed
-
+ userWithFirstName:lastName:
Create new OIUser instance by email, first name and last name.
-
+ updatePassword:usingBlock:
Update user password.
Address Methods
-
– initAllAddresses
Load all user addresses into the OIUser instance. Call block with nil parameter.
-
– addAddress:
Add address (OIAddress) to the server and to the addresses of the user (OIUser).
-
– updateAddressAtIndex:withAddress:
Change user address (overwrite).
-
– deleteAddressByNickname:
Delete user address by its nickname.
CreditCard Methods
-
– initAllCreditCards
Load all user credit cards into the OIUser instance.
-
– addCreditCard:
Add credit card (OICardInfo) to the server and to the credit cards of the user (OIUser).
-
– updateCreditCardAtIndex:withCreditCard:
Change user credit card (overwrite).
-
– deleteCreditCardByNickname:
Delete user credit card by its nickname.
Order Methods
Properties
addresses
Array of user addresses.
@property (nonatomic, readwrite, retain) NSMutableArray *addresses
Discussion
Array of user addresses.
Declared In
OIUser.h
creditCards
Array of user credit cards.
@property (nonatomic, readwrite, retain) NSMutableArray *creditCards
Discussion
Array of user credit cards.
Declared In
OIUser.h
firstName
First name.
@property (nonatomic, readwrite, copy) NSString *firstName
Discussion
First name.
Declared In
OIUser.h
Class Methods
accountInfo:password:usingBlockUser:usingBlockError:
Load account information by user email and password.
+ (void)accountInfo:(NSString *)email password:(NSString *)password usingBlockUser:(void ( ^ ) ( OIUser *user ))blockUser usingBlockError:(void ( ^ ) ( NSError *error ))blockError
Parameters
User email.
- password
User password.
Return Value
block Return (OIUser) instance if request finished correctly.
blockError Return (NSError) instance.
Discussion
Load account information by user email and password.
Declared In
OIUser.h
createNewAccount:email:password:usingBlock:
Create new account for OIUser instance. Call block with nil parameter if succeeded or with a request error if failed
+ (void)createNewAccount:(OIUser *)account email:(NSString *)email password:(NSString *)password usingBlock:(void ( ^ ) ( NSError *error ))block
Return Value
block Return nil if request finished correctly.
Discussion
Create new account for OIUser instance. Call block with nil parameter if succeeded or with a request error if failed
Declared In
OIUser.h
updatePassword:usingBlock:
Update user password.
+ (void)updatePassword:(NSString *)password usingBlock:(void ( ^ ) ( NSError *error ))block
Parameters
- password
New password.
- block
Block return nil if request finished successfully else error (NSError).
Discussion
Update user password.
Declared In
OIUser.h
userWithFirstName:lastName:
Create new OIUser instance by email, first name and last name.
+ (OIUser *)userWithFirstName:(NSString *)firstName lastName:(NSString *)lastName
Parameters
- firstName
First name of user.
- lastName
Last name of user.
Discussion
Create new OIUser instance by email, first name and last name.
Declared In
OIUser.h
Instance Methods
addCreditCard:
Add credit card (OICardInfo) to the server and to the credit cards of the user (OIUser).
- (void)addCreditCard:(OICardInfo *)creditCard
Parameters
- address
New credit card (OICardInfo), which will be added to the user credit cards (server, application).
Discussion
Add credit card (OICardInfo) to the server and to the credit cards of the user (OIUser).
Declared In
OIUser.h
deleteAddressByNickname:
Delete user address by its nickname.
- (void)deleteAddressByNickname:(NSString *)nickname
Parameters
- nickname
Addresses nickname, which will be deleted.
Discussion
Delete user address by its nickname.
Declared In
OIUser.h
deleteCreditCardByNickname:
Delete user credit card by its nickname.
- (void)deleteCreditCardByNickname:(NSString *)nickname
Parameters
- nickname
Credit cards nickname, which will be deleted.
Discussion
Delete user credit card by its nickname.
Declared In
OIUser.h
initAllCreditCards
Load all user credit cards into the OIUser instance.
- (void)initAllCreditCards
Discussion
Load all user credit cards into the OIUser instance.
Declared In
OIUser.h
updateAddressAtIndex:withAddress:
Change user address (overwrite).
- (void)updateAddressAtIndex:(NSUInteger)index withAddress:(OIAddress *)newAddress
Parameters
- newAddress
Changed address (OIAddress), which will replace previous address.
Discussion
Change user address (overwrite).
Declared In
OIUser.h
updateCreditCardAtIndex:withCreditCard:
Change user credit card (overwrite).
- (void)updateCreditCardAtIndex:(NSUInteger)index withCreditCard:(OICardInfo *)newCreditCard
Parameters
- index
Index of the credit card (OICardInfo) in user credit cards, which will be updated.
- newCreditCard
(OICardInfo) Changed credit card, which will replace previous credit card.
Discussion
Change user credit card (overwrite).
Declared In
OIUser.h