LCObject

Objective-C

@interface LCObject : NSObject <NSCoding>

Swift

class LCObject : NSObject, NSCoding

Undocumented

Constructors

  • Undocumented

    Declaration

    Objective-C

    + (nonnull instancetype)objectWithObjectId:(nonnull NSString *)objectId;

    Swift

    convenience init(objectId: String)

Creating a LCObject */

  • Undocumented

    Declaration

    Objective-C

    + (nonnull instancetype)objectWithClassName:(nonnull NSString *)className;
  • Undocumented

    Declaration

    Objective-C

    + (nonnull instancetype)objectWithClassName:(nonnull NSString *)className
                                       objectId:(nonnull NSString *)objectId;

    Swift

    convenience init(className: String, objectId: String)
  • Undocumented

    Declaration

    Objective-C

    + (nonnull instancetype)objectWithClassName:(nonnull NSString *)className
                                     dictionary:(nonnull NSDictionary *)dictionary;

    Swift

    convenience init(className: String, dictionary: [AnyHashable : Any])
  • Undocumented

    Declaration

    Objective-C

    - (nonnull instancetype)initWithClassName:(nonnull NSString *)newClassName;

    Swift

    init(className newClassName: String)

Bahaviour Control

  • If YES, Null value will be converted to nil when getting object for key. Because [NSNull null] is truthy value in Objective-C. Default is YES and suggested.

    Warning

    It takes effects only when getting object for key. You can still use Null in setObject:forKey.

    Declaration

    Objective-C

    + (void)setConvertingNullToNil:(BOOL)yesOrNo;

    Swift

    class func setConvertingNullToNil(_ yesOrNo: Bool)

    Parameters

    yesOrNo

    default is YES.

Managing Object Properties */

  • Undocumented

    Declaration

    Objective-C

    @property (nonatomic, copy, readonly, nullable) NSString *objectId;

    Swift

    var objectId: String? { get }
  • Undocumented

    Declaration

    Objective-C

    @property (nonatomic, strong, readonly, nullable) NSDate *updatedAt;

    Swift

    var updatedAt: Date? { get }
  • Undocumented

    Declaration

    Objective-C

    @property (nonatomic, strong, readonly, nullable) NSDate *createdAt;

    Swift

    var createdAt: Date? { get }
  • Undocumented

    Declaration

    Objective-C

    @property (nonatomic, copy, readonly) NSString *_Nonnull className;

    Swift

    var className: String { get }
  • ACL

    Undocumented

    Declaration

    Objective-C

    @property (nonatomic, strong, nullable) LCACL *ACL;

    Swift

    var acl: LCACL? { get set }
  • Undocumented

    Declaration

    Objective-C

    - (nonnull NSArray *)allKeys;

    Swift

    func allKeys() -> [Any]

Get and set

Array add and remove

  • Undocumented

    Declaration

    Objective-C

    - (void)addObject:(nonnull id)object forKey:(nonnull NSString *)key;

    Swift

    func add(_ object: Any, forKey key: String)
  • Undocumented

    Declaration

    Objective-C

    - (void)addObjectsFromArray:(nonnull NSArray *)objects
                         forKey:(nonnull NSString *)key;

    Swift

    func addObjects(from objects: [Any], forKey key: String)
  • Undocumented

    Declaration

    Objective-C

    - (void)addUniqueObject:(nonnull id)object forKey:(nonnull NSString *)key;

    Swift

    func addUniqueObject(_ object: Any, forKey key: String)
  • Undocumented

    Declaration

    Objective-C

    - (void)addUniqueObjectsFromArray:(nonnull NSArray *)objects
                               forKey:(nonnull NSString *)key;

    Swift

    func addUniqueObjects(from objects: [Any], forKey key: String)
  • Undocumented

    Declaration

    Objective-C

    - (void)removeObject:(nonnull id)object forKey:(nonnull NSString *)key;

    Swift

    func remove(_ object: Any, forKey key: String)
  • Undocumented

    Declaration

    Objective-C

    - (void)removeObjectsInArray:(nonnull NSArray *)objects
                          forKey:(nonnull NSString *)key;

    Swift

    func removeObjects(in objects: [Any], forKey key: String)

Increment

  • Undocumented

    Declaration

    Objective-C

    - (void)incrementKey:(nonnull NSString *)key;

    Swift

    func incrementKey(_ key: String)
  • Undocumented

    Declaration

    Objective-C

    - (void)incrementKey:(nonnull NSString *)key
                byAmount:(nonnull NSNumber *)amount;

    Swift

    func incrementKey(_ key: String, byAmount amount: NSNumber)

Saving an Object to LeanCloud */

Saving Many Objects to LeanCloud */

Removing an Object from LeanCloud */

Methods for Subclasses */