MNFObject

Objective-C

@interface MNFObject : NSObject <MNFJsonAdapterDelegate>

Swift

class MNFObject : NSObject, MNFJsonAdapterDelegate

The MNFObject class is the superclass for all objects in the Meniga SDK.

The superclass handless internal operations of the objects and state handling.

  • @abstract Identifier for the object.

    @discussion This identifier is common to all objects that are serialized from the server.

    Declaration

    Objective-C

    @property (nonatomic, strong, readonly) NSNumber *_Nonnull identifier;

    Swift

    var identifier: NSNumber { get }
  • @abstract Whether the object is dirty and needs to be saved to the server.

    Declaration

    Objective-C

    @property (nonatomic, readonly, getter=isDirty) BOOL dirty;

    Swift

    var isDirty: Bool { get }
  • @abstract Whether the object has been deleted from the server.

    Declaration

    Objective-C

    @property (nonatomic, readonly, getter=isDeleted) BOOL deleted;

    Swift

    var isDeleted: Bool { get }
  • @abstract Whether the object has yet to be created on the server.

    @discussion Only user created objects are marked as new and need to be created on the server. Once they are created the object is no longer marked as new.

    Declaration

    Objective-C

    @property (nonatomic, readonly) BOOL isNew;

    Swift

    var isNew: Bool { get }
  • @abstract Reverts the object to the last fetched server data

    Declaration

    Objective-C

    - (void)revert;

    Swift

    func revert()