Captainup  2.4
Instance Methods | Properties | List of all members
<CPTObject> Protocol Reference

#import <CPTObject.h>

Inheritance diagram for <CPTObject>:
<CPTAcquiredAsset> <CPTAction> <CPTActionableEntity> <CPTActionableEntitySchema> <CPTActionSettings> <CPTApplication> <CPTAsset> <CPTAvailableReward> <CPTBadge> <CPTBadgeProgress> <CPTCondition> <CPTConditionProgress> <CPTCurrency> <CPTCurrencySettings> <CPTFieldSchema> <CPTGameCenter> <CPTImageFiles> <CPTInboxItem> <CPTIntegrationUser> <CPTLevel> <CPTResponse> <CPTReward> <CPTRewardData> <CPTRewardProgress> <CPTRewardType> <CPTRewardTypeProperty> <CPTTheme> <CPTUser>

Instance Methods

(nonnull instancetype) - initWithDictionary:
 
(nonnull NSDictionary< NSString *, id > *) - toDictionary
 

Properties

NSDictionary< NSString *, id > * sourceDictionary
 

Detailed Description

A protocol which all captain up entity classes conform to. It exposes the original JSON Dictionary that the entity was created from.

Method Documentation

◆ initWithDictionary:()

- (nonnull instancetype) initWithDictionary: (nonnull NSDictionary< NSString *, id > *)  dictionary
optional

If the CPTObject is based on a Captain Up API Object , then it also must know how to initialize itself from a JSON dictionary

Parameters
dictionarysource dictionary
Returns
return new instance

◆ toDictionary()

- (nonnull NSDictionary<NSString*,id>*) toDictionary
optional

Any CPTObject must know how to transform itself to a JSON dictionary

Returns
return NSDictionary object

Property Documentation

◆ sourceDictionary

- (NSDictionary<NSString*,id>*) sourceDictionary
readoptionalnonatomicassign

Use this dictionary in case an attribute is missing from the actual entity protocol. For example, if an attribute was added to the Captain Up REST services, but it is not yet reflected in the iOS SDK. For all other situations, use the specific entity protocol properties.


The documentation for this protocol was generated from the following file: