Open Facebook Page from iOS App OpenUrl

You have to use the facebook ID for the given page rather than the vanity URL. To get the pages ID, enter your page’s vanity name at the following URL and copy the value for “id":

https://graph.facebook.com/yourappspage

Once you have the id, you can set up the method to check if FB is installed using the canOpenURL method and serve the appropriate content for both states:

NSURL *facebookURL = [NSURL URLWithString:@"fb://profile/113810631976867″];
if ([[UIApplication sharedApplication] canOpenURL:facebookURL]) {
[[UIApplication sharedApplication] openURL:facebookURL];
} else {
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"http://facebook.com"]];
}

http://stackoverflow.com/questions/16589367/open-link-to-facebook-page-from-ios-app

Objective C : Array iteration

Normal:

[sampleArray enumerateObjectsUsingBlock:^(NSString *symbol, NSUInteger idx, BOOL *stop) {
NSLog(@"%@", symbol);

if ([symbol isEqualToString:@"8″]) {
*stop = YES;
}
}];

Reverse:

[sampleArray enumerateObjectsWithOptions:NSEnumerationReverse usingBlock:^(NSString *symbol, NSUInteger idx, BOOL *stop) {
NSLog(@"%@", symbol);

if ([symbol isEqualToString:@"8″]) {
*stop = YES;
}
}];

http://myappglog.blogspot.hk/2013_08_01_archive.html

When using Storyboard and Xib in same project…

When you extend viewcontroller that using xib

Xib will call:

– (instancetype)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil

But viewcontroller using storyboard wont call, so you need to define things within initwithcoder or initwithStyle

– (id)initWithCoder:(NSCoder *)aDecoder
{
self = [super initWithCoder:aDecoder];
if (self) {
// Custom initialization
}
return self;
}

– (id)initWithStyle:(UITableViewStyle)style
{
self = [super initWithStyle:style];
if (self) {
// Custom initialization
}
return self;
}

http://stackoverflow.com/questions/11973054/initwithnibname-method-in-storyboard