Monday, 11 June 2012

Date Format Patterns

A date pattern is a string of characters, where specific strings of characters are replaced with date and time data from a calendar when formatting or used to generate data for a calendar when parsing. The following are the characters used in patterns to show the appropriate formats for a given locale.

http://unicode.org/reports/tr35/tr35-6.html#Date_Format_Patterns

Thursday, 7 June 2012

Get Data From User Facebook Wall Post and Twitter Tweets

Get Data From User Facebook Wall Posts and Twitter Tweets

Twitter:
https://dev.twitter.com/docs/api/1/get/statuses/user_timeline
https://api.twitter.com/1/statuses/user_timeline.json?screen_name=zaintiger
https://api.twitter.com/1/statuses/user_timeline.json?screen_name=ISEE_Events

Facebook
http://stackoverflow.com/questions/6244693/using-app-access-token-in-ios
http://blog.awpny.com/kaiawpny/2011/how-to-facebook-access-token.html

https://graph.facebook.com/oauth/access_token?grant_type=client_credentials&client_id=121128207961282&client_secret=19f13a3ef1b80961f88f7bfd928ab0f3

https://graph.facebook.com/isee.Entertainment.and.Events
/posts?access_token=121128207961282|9QQBCRY8vflHgc11KIcWAbvRPRk

Monday, 23 April 2012

Limit number of characters in uitextview

if(range.length > text.length){
    return YES;
}else if([[textView text] length] + text.length > 140){
    return NO;
}
return YES;

Sunday, 22 April 2012

Monday, 16 April 2012

Email and URL Validation in Objective-C

Use this Code for Email Validation:

- (BOOL) validateEmail: (NSString *) candidate {
    NSString *emailRegex = @"[A-Z0-9a-z._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,4}";
    NSPredicate *emailTest = [NSPredicate predicateWithFormat:@"SELF MATCHES %@", emailRegex]; 
    return [emailTest evaluateWithObject:txtEmail.text];
}


Use this Code for URL Validation:


- (BOOL) validateUrl: (NSString *) candidate {
    NSString *urlRegEx =@"(http|https)://((\\w)*|([0-9]*)|([-|_])*)+([\\.|/]((\\w)*|([0-9]*)|([-|_])*))+";
    NSPredicate *urlTest = [NSPredicate predicateWithFormat:@"SELF MATCHES %@", urlRegEx];
    return [urlTest evaluateWithObject:txtUrl.text];
}