Sunday, August 4, 2013

AFHTTPClient *httpClient = [[AFHTTPClient alloc] initWithBaseURL:[NSURL URLWithString:@"https://graph.facebook.com/"]]; NSString *link = [NSString stringWithFormat:@"https://graph.facebook.com/%@/likes/%@", USER_ID, PAGE_ID]; NSDictionary *params = @{@"access_token" : [[[FBSession activeSession] accessTokenData] accessToken]}; NSMutableURLRequest *request = [httpClient...

Friday, August 2, 2013

iOS, Set CoreData up.

1- Link against CoreData.framework 2- add the following to the appDelegate.h @property (nonatomic, strong) NSManagedObjectContext *managedObjectContext; @property (nonatomic, strong) NSManagedObjectModel *managedObjectModel; @property (nonatomic, strong) NSPersistentStoreCoordinator *persistentStoreCoordinator; 3- add the following to the appDelegate.m #import <coredata/coredata.h> // Returns...

iOS email validator

-(BOOL) isValidEmail:(NSString *)checkString { BOOL stricterFilter = YES; // Discussion http://blog.logichigh.com/2010/09/02/validating-an-e-mail-address/ NSString *stricterFilterString = @"[A-Z0-9a-z._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,4}"; NSString *laxString = @".+@.+\\.[A-Za-z]{2}[A-Za-z]*"; NSString *emailRegex = stricterFilter ? stricterFilterString : laxString; NSPredicate...