/*
______
/ / __ __ __
/ / ____ / // / / /_
/ /// __ / / // / /
/ / / / / / // // / /
_/// //_// _/_/
*/
This is a Observation Object model for using KVO.
Model is so easy creation from JSON Object.
be carefully Using This.
KVO is not a Simple and hard for Debuging.
Define to Model from Super class. (model is SubClass for SuperModel)
create model like this.
#import "SuperModel.h"
@interface Like : SuperModel
@property (strong, nonatomic) NSString *movie;
@property (strong, nonatomic) NSString *sports;
@property (strong, nonatomic) NSString *something;
@end
and make instance of model using '- (id)initWithDictionary' method not '- (id)init'
more sample & Information : User.h/User.m
imort ALModelManager and declared DataModel`s (Property)
@interface ALModelManager : NSObject
// Here!
@property (strong, nonatomic) Like *likes;
....
+ (ALModelManager *)sharedInstance;
+ (void)releaseInstance;
@end
add Observation and Remove Observation
- (id)initWithCoder:(NSCoder *)aDecoder
{
self = [super initWithCoder:aDecoder];
if (self) {
_alt = [[ALTransaction alloc] initWithTarget:self
successSelector:@selector(recieveSuccess:)
failureSelector:@selector(recieveFailure:)];
}
return self;
}
- (void)recieveSuccess:(id)result
{
}
- (void)recieveFailure:(id)result
{
}
don`t forget Remove all KVO.
- (void)applicationDidEnterBackground:(UIApplication *)application
{
[self removeAllObservations];
[self removeAllObservers];
}
Think you’ve found a bug?
Please open a case in issue page.
GNU GPL V2 - Read a Lincense file.