LCObject
Objective-C
@interface LCObject : NSObject <NSCoding>
Swift
class LCObject : NSObject, NSCoding
Undocumented
-
Undocumented
Declaration
Objective-C
+ (nonnull instancetype)objectWithObjectId:(nonnull NSString *)objectId;Swift
convenience init(objectId: String)
-
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)
-
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
yesOrNodefault is YES.
-
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 } -
Undocumented
Declaration
Objective-C
- (nonnull NSArray *)allKeys;Swift
func allKeys() -> [Any]
-
Undocumented
Declaration
Objective-C
- (nullable id)objectForKey:(nonnull NSString *)key;Swift
func object(forKey key: String) -> Any? -
Undocumented
Declaration
Objective-C
- (void)setObject:(nullable id)object forKey:(nonnull NSString *)key;Swift
func setObject(_ object: Any?, forKey key: String) -
Undocumented
Declaration
Objective-C
- (void)removeObjectForKey:(nonnull NSString *)key;Swift
func remove(forKey key: String) -
Undocumented
Declaration
Objective-C
- (nullable id)objectForKeyedSubscript:(nonnull NSString *)key;Swift
subscript(key: String) -> Any? { get set } -
Undocumented
Declaration
Objective-C
- (void)setObject:(nullable id)object forKeyedSubscript:(nonnull NSString *)key; -
Undocumented
Declaration
Objective-C
- (nonnull LCRelation *)relationForKey:(nonnull NSString *)key;Swift
func relation(forKey key: String) -> LCRelation
-
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)
-
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)
-
Undocumented
Declaration
Objective-C
- (BOOL)save;Swift
func save() -> Bool -
Undocumented
Declaration
Objective-C
- (BOOL)save:(NSError *_Nullable *_Nullable)error;Swift
func save(_ error: NSErrorPointer) -> Bool -
Undocumented
Declaration
Objective-C
- (BOOL)saveAndThrowsWithError:(NSError *_Nullable *_Nullable)error;Swift
func saveAndThrows() throws -
Undocumented
Declaration
Objective-C
- (BOOL)saveWithOption:(nullable LCSaveOption *)option error:(NSError *_Nullable *_Nullable)error;Swift
func save(with option: LCSaveOption?) throws -
Undocumented
Declaration
Objective-C
- (BOOL)saveWithOption:(nullable LCSaveOption *)option eventually:(BOOL)eventually error:(NSError *_Nullable *_Nullable)error;Swift
func save(with option: LCSaveOption?, eventually: Bool) throws -
Undocumented
Declaration
Objective-C
- (void)saveInBackground;Swift
func saveInBackground() -
Undocumented
Declaration
Objective-C
- (void)saveInBackgroundWithBlock:(nonnull LCBooleanResultBlock)block;Swift
func saveInBackground() async throws -> Bool -
Undocumented
Declaration
Objective-C
- (void)saveInBackgroundWithOption:(nullable LCSaveOption *)option block:(nonnull LCBooleanResultBlock)block;Swift
func saveInBackground(with option: LCSaveOption?, block: @escaping LCBooleanResultBlock) -
Undocumented
Declaration
Objective-C
- (void)saveInBackgroundWithOption:(nullable LCSaveOption *)option eventually:(BOOL)eventually block:(nonnull LCBooleanResultBlock)block;Swift
func saveInBackground(with option: LCSaveOption?, eventually: Bool, block: @escaping LCBooleanResultBlock) -
Undocumented
Declaration
Objective-C
- (void)saveEventually;Swift
func saveEventually() -
Undocumented
Declaration
Objective-C
- (void)saveEventually:(nonnull LCBooleanResultBlock)callback;Swift
func saveEventually(_ callback: @escaping LCBooleanResultBlock)
-
Undocumented
Declaration
Objective-C
+ (BOOL)saveAll:(nonnull NSArray *)objects;Swift
class func saveAll(_ objects: [Any]) -> Bool -
Undocumented
Declaration
Objective-C
+ (BOOL)saveAll:(nonnull NSArray *)objects error:(NSError *_Nullable *_Nullable)error;Swift
class func saveAll(_ objects: [Any], error: ()) throws -
Undocumented
Declaration
Objective-C
+ (void)saveAllInBackground:(nonnull NSArray *)objects;Swift
class func saveAll(inBackground objects: [Any]) -
Undocumented
Declaration
Objective-C
+ (void)saveAllInBackground:(nonnull NSArray *)objects block:(nonnull LCBooleanResultBlock)block;Swift
class func saveAll(inBackground objects: [Any], block: @escaping LCBooleanResultBlock) -
Fetching the data of the object from the server synchronously.
Declaration
Objective-C
- (BOOL)fetch;Swift
func fetch() -> Bool -
Fetching the data of the object from the server synchronously.
Declaration
Objective-C
- (BOOL)fetchAndThrowsWithError:(NSError *_Nullable *_Nullable)error;Swift
func fetchAndThrows() throwsParameters
errorThe pointer of
NSError *. -
Fetching the data of the object from the server synchronously.
Declaration
Objective-C
- (BOOL)fetchWithOption:(nullable LCObjectFetchOption *)option error:(NSError *_Nullable *_Nullable)error;Swift
func fetch(with option: LCObjectFetchOption?) throwsParameters
optionSee
LCObjectFetchOption.errorThe pointer of
NSError *. -
Fetching the data of the object from the server asynchronously.
Declaration
Objective-C
- (void)fetchInBackgroundWithBlock:(nonnull LCObjectResultBlock)block;Swift
func fetchInBackground() async throws -> LCObjectParameters
blockResult callback.
-
Fetching the data of the object from the server asynchronously.
Declaration
Objective-C
- (void)fetchInBackgroundWithOption:(nullable LCObjectFetchOption *)option block:(nonnull LCObjectResultBlock)block;Swift
func fetchInBackground(with option: LCObjectFetchOption?, block: @escaping LCObjectResultBlock)Parameters
optionSee
LCObjectFetchOption.blockResult callback.
-
Undocumented
Declaration
Objective-C
+ (BOOL)fetchAll:(nonnull NSArray *)objects error:(NSError *_Nullable *_Nullable)error;Swift
class func fetchAll(_ objects: [Any], error: ()) throws -
Undocumented
Declaration
Objective-C
+ (void)fetchAllInBackground:(nonnull NSArray *)objects block:(nonnull LCArrayResultBlock)block;Swift
class func fetchAll(inBackground objects: [Any], block: @escaping LCArrayResultBlock)
-
Undocumented
Declaration
Objective-C
- (BOOL)delete;Swift
func delete() -> Bool -
Undocumented
Declaration
Objective-C
- (BOOL)delete:(NSError *_Nullable *_Nullable)error;Swift
func delete(_ error: NSErrorPointer) -> Bool -
Undocumented
Declaration
Objective-C
- (BOOL)deleteAndThrowsWithError:(NSError *_Nullable *_Nullable)error;Swift
func deleteAndThrows() throws -
Undocumented
Declaration
Objective-C
- (void)deleteInBackground;Swift
func deleteInBackground() -
Undocumented
Declaration
Objective-C
- (void)deleteInBackgroundWithBlock:(nonnull LCBooleanResultBlock)block;Swift
func deleteInBackground() async throws -> Bool -
Undocumented
Declaration
Objective-C
- (void)deleteEventually;Swift
func deleteEventually() -
Undocumented
Declaration
Objective-C
- (void)deleteEventuallyWithBlock:(nonnull LCIdResultBlock)block;Swift
func deleteEventually() async throws -> Any -
Undocumented
Declaration
Objective-C
+ (BOOL)deleteAll:(nonnull NSArray *)objects;Swift
class func deleteAll(_ objects: [Any]) -> Bool -
Undocumented
Declaration
Objective-C
+ (BOOL)deleteAll:(nonnull NSArray *)objects error:(NSError *_Nullable *_Nullable)error;Swift
class func deleteAll(_ objects: [Any], error: ()) throws -
Deletes all objects specified in object array. The element of objects array is LCObject or its subclass.
Declaration
Objective-C
+ (void)deleteAllInBackground:(nonnull NSArray *)objects block:(nonnull LCBooleanResultBlock)block;Swift
class func deleteAll(inBackground objects: [Any], block: @escaping LCBooleanResultBlock)Parameters
objectsobject array
blockThe block to execute. The block should have the following argument signature: (BOOL succeeded, NSError *error)
-
Undocumented
Declaration
Objective-C
@property (nonatomic) BOOL fetchWhenSaveSwift
var fetchWhenSave: Bool { get set } -
Undocumented
Declaration
Objective-C
+ (nullable LCObject *)objectWithDictionary:(nonnull NSDictionary *)dictionary;Swift
/*not inherited*/ init?(dictionary: [AnyHashable : Any]) -
Undocumented
Declaration
Objective-C
- (nonnull NSMutableDictionary *)dictionaryForObject;Swift
func dictionaryForObject() -> NSMutableDictionary -
Load object properties from JSON dictionary.
Declaration
Objective-C
- (void)objectFromDictionary:(nonnull NSDictionary *)dictionary;Swift
func object(from dictionary: [AnyHashable : Any])Parameters
dictionaryJSON dictionary
-
Deprecated
Deprecated! please use
-[LCObject fetchAndThrowsWithError:]instead, this method may be removed in the future.Undocumented
Declaration
Objective-C
- (BOOL)fetch:(NSError *_Nullable *_Nullable)error;Swift
func fetch(_ error: NSErrorPointer) -> Bool -
Deprecated
Deprecated! please use
-[LCObject fetchWithOption:error:]instead, this method may be removed in the future.Undocumented
Declaration
Objective-C
- (void)fetchWithKeys:(nullable NSArray *)keys;Swift
func fetch(withKeys keys: [Any]?) -
Deprecated
Deprecated! please use
-[LCObject fetchWithOption:error:]instead, this method may be removed in the future.Undocumented
Declaration
Objective-C
- (BOOL)fetchWithKeys:(nullable NSArray *)keys error:(NSError *_Nullable *_Nullable)error;Swift
func fetch(withKeys keys: [Any]?, error: ()) throws -
Deprecated
Deprecated! please use
-[LCObject fetchAndThrowsWithError:]instead, this method may be removed in the future.Undocumented
Declaration
Objective-C
- (nonnull LCObject *)fetchIfNeeded;Swift
func fetchIfNeeded() -> LCObject -
Deprecated
Deprecated! please use
-[LCObject fetchAndThrowsWithError:]instead, this method may be removed in the future.Undocumented
Declaration
Objective-C
- (nonnull LCObject *)fetchIfNeeded:(NSError *_Nullable *_Nullable)error;Swift
func fetchIfNeeded(_ error: NSErrorPointer) -> LCObject -
Deprecated
Deprecated! please use
-[LCObject fetchAndThrowsWithError:]instead, this method may be removed in the future.Undocumented
Declaration
Objective-C
- (nonnull LCObject *)fetchIfNeededAndThrowsWithError: (NSError *_Nullable *_Nullable)error;Swift
func fetchIfNeededAndThrowsWithError(_ error: NSErrorPointer) -> LCObject -
Deprecated
Deprecated! please use
-[LCObject fetchWithOption:error:]instead, this method may be removed in the future.Undocumented
Declaration
Objective-C
- (nonnull LCObject *)fetchIfNeededWithKeys:(nullable NSArray *)keys;Swift
func fetchIfNeeded(withKeys keys: [Any]?) -> LCObject -
Deprecated
Deprecated! please use
-[LCObject fetchWithOption:error:]instead, this method may be removed in the future.Undocumented
Declaration
Objective-C
- (nonnull LCObject *)fetchIfNeededWithKeys:(nullable NSArray *)keys error: (NSError *_Nullable *_Nullable)error;Swift
func fetchIfNeeded(withKeys keys: [Any]?, error: NSErrorPointer) -> LCObject -
Deprecated
Deprecated! please use
-[LCObject fetchInBackgroundWithOption:block:]instead, this method may be removed in the future.Undocumented
Declaration
Objective-C
- (void)fetchInBackgroundWithKeys:(nullable NSArray *)keys block:(nonnull LCObjectResultBlock)block;Swift
func fetchInBackground(withKeys keys: [Any]?, block: @escaping LCObjectResultBlock) -
Deprecated
Deprecated! please use
-[LCObject fetchInBackgroundWithOption:block:]instead, this method may be removed in the future.Undocumented
Declaration
Objective-C
- (void)fetchIfNeededInBackgroundWithBlock:(nonnull LCObjectResultBlock)block;Swift
func fetchIfNeededInBackground() async throws -> LCObject -
Deprecated
Deprecated! please use
+[LCObject fetchAll:error:]instead, this method may be removed in the future.Undocumented
Declaration
Objective-C
+ (void)fetchAll:(nonnull NSArray *)objects;Swift
class func fetchAll(_ objects: [Any]) -
Deprecated
Deprecated! please use
+[LCObject fetchAll:error:]instead, this method may be removed in the future.Undocumented
Declaration
Objective-C
+ (void)fetchAllIfNeeded:(nonnull NSArray *)objects;Swift
class func fetchAllIfNeeded(_ objects: [Any]) -
Deprecated
Deprecated! please use
+[LCObject fetchAll:error:]instead, this method may be removed in the future.Undocumented
Declaration
Objective-C
+ (BOOL)fetchAllIfNeeded:(nonnull NSArray *)objects error:(NSError *_Nullable *_Nullable)error;Swift
class func fetchAllIfNeeded(_ objects: [Any], error: ()) throws -
Deprecated
Deprecated! please use
+[LCObject fetchAllInBackground:block:]instead, this method may be removed in the future.Undocumented
Declaration
Objective-C
+ (void)fetchAllIfNeededInBackground:(nonnull NSArray *)objects block:(nonnull LCArrayResultBlock)block;Swift
class func fetchAllIfNeeded(inBackground objects: [Any], block: @escaping LCArrayResultBlock)
-
Undocumented
Declaration
Objective-C
+ (nonnull instancetype)object; -
Undocumented
Declaration
Objective-C
+ (void)registerSubclass;Swift
class func registerSubclass() -
Undocumented
View on GitHub
Install in Dash
LCObject Class Reference