-1
그래프 API로 작업하기 시작했는데 그래프 API 호출을하지 않고 로그인 만하면됩니다. 나는 델리게이트 (나는 생각한다)를 설정했지만, 구현 한 델리게이트 메소드를 다시 호출하지는 않는다. 여기 내 코드입니다 :그래프 API가 작동하지 않습니다.
#import <UIKit/UIKit.h>
#import "Profile.h"
#import "AppDelegate.h"
#import "FBRequest.h"
@interface HomeViewController : UITableViewController <FBRequestDelegate>
{
Profile *profile;
AppDelegate *appDelegate;
}
- (void)request:(FBRequest *)request didLoad:(id)result;
@end
구현 :
- (void)viewDidLoad
{
[super viewDidLoad];
profile = [[Profile alloc] initWithUserId:1];
[profile refreshMatchesWithCallback:^
{
[self.tableView reloadData];
}];
[appDelegate.facebook requestWithGraphPath:[NSString stringWithFormat: @"me", appDelegate.facebook.accessToken] andDelegate:self];
[[appDelegate facebook] requestWithGraphPath:@"me" andDelegate:self];
// Uncomment the following line to preserve selection between presentations.
// self.clearsSelectionOnViewWillAppear = NO;
// Uncomment the following line to display an Edit button in the navigation bar for this view controller.
// self.navigationItem.rightBarButtonItem = self.editButtonItem;
}
- (void)request:(FBRequest *)request didLoad:(id)result {
NSLog(@"%@", result);
}
- (void)request:(FBRequest *)request didFailWithError:(NSError *)error {
NSLog(@"erre");
}