iPhone Facebook app: Finding out where the error is?
So I just added Facebook to a previous app that was working. And I basically just included the code for a button press to upload/post the picture selected to Facebook -- nothing happened.
Are there any good resources for learning the syntax for iOS Facebook apps? Because I'm lost. Also, could you tell me why this seemingly simple code doesn't work? Because I pretty much copied it from the demo app example.
- (IBAction) sendPressed:(UIButton *)sender
{
for(UIViewController *controller in self.tabBarController.viewControllers)
{
if([controller isKindOfClass:[FirstViewController class]])
{
FirstViewController *firstViewController = (FirstViewController *)controller;
[firstViewController realLabel];
}
}
Facebook *facebook = [[Facebook alloc] initWithAppId:@"198223696897308"];
NSMutableDictionary *pa开发者_运维百科rams = [NSMutableDictionary dictionaryWithObjectsAndKeys:
image, @"picture",
nil];
[facebook requestWithGraphPath:@"me/photos"
andParams:params
andHttpMethod:@"POST"
andDelegate:self];
self.tabBarController.selectedIndex = 0;//switch over to the first view to see if it worked
}
The first thing I'd do is verify that the method is actually being called by setting a breakpoint or outputting a log statement.
The second thing I'd do is look at the API documentation to see if any of the methods I'm calling provide errors in any way. They almost certainly do, so check what they say.
The third thing I'd do is set the device to use a proxy (e.g. Charles) to see if the requests are actually being sent out over the wire.
精彩评论