iPhone Game Development by Chris Craft

iPhone Game Development by Chris Craft

Author:Chris Craft
Language: eng
Format: mobi, epub
ISBN: 9780470496664
Publisher: John Wiley & Sons, Ltd.
Published: 2010-03-10T10:00:00+00:00


@interface MainViewController : UIViewController {

}

To label the MainViewController as implementing the FBSessionDelegate protocol, you need to add the name of the protocol to the inside of a pair of angle brackets right before the curly braces:

#import <UIKit/UIKit.h>

#import “FBConnect/FBConnect.h”

@interface MainViewController : UIViewController <FBSessionDelegate> {

}

Also notice how you will need to add a new import statement to the MainViewController.h file. This instructs the compiler where to search to learn what makes the FBSessionDelegate work.

By adding the FBSessionDelegate to your MainViewController.h file, you are promising the compiler that it will be able to find any methods required by the FBSessionDelegate in your MainViewController.m file. That means at a minimum you will need to implement the didLogin method of the FBSessionDelegate in your MainViewController.m file.

Creating alert views

Add the following didLogin method to your MainViewController class. This code displays an alert view to the user when the application is able to log in to Facebook Connect. The alert view displays the text “Oh Yeah!” and waits for the user to click the OK button to close the dialog box:

////////////////////////////////////////////////////////////////////////////////



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.