我已经使用Xcode 7在App Delegate中为Facebook登录实现了这种方法,它完美地运行:
- (BOOL)application:(UIApplication *)app openURL:(NSURL *)url options:(NSDictionary<NSString*, id> *)options {
return [[FBSDKApplicationDelegate sharedInstance] application:app
openURL:url
sourceApplication:options[UIApplicationOpenURLOptionsSourceApplicationKey]
annotation:options[UIApplicationOpenURLOptionsAnnotationKey]];
}
Run Code Online (Sandbox Code Playgroud)
但是,由于我需要使用Xcode 6将我的应用程序提交到App Store,因此该方法不存在并且它会给我带来错误.
如果我评论上述方法,只留下以下内容:
- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation {
return [[FBSDKApplicationDelegate sharedInstance] application:application
openURL:url
sourceApplication:sourceApplication
annotation:annotation
];
}
Run Code Online (Sandbox Code Playgroud)
它不起作用,也就是说,当用户尝试登录时,它不会返回到应用程序.
这有一个简单的解决方案吗?谢谢!
顺便说一下,我一直在努力遵循所有步骤:https://developers.facebook.com/docs/ios/getting-started
有谁知道我为了将我自己的视图控制器手动添加到UIPageViewController方法而缺少什么?
我目前有这个,我不知道如何继续:
NSDictionary *pageViewOptions = [NSDictionary dictionaryWithObjectsAndKeys:UIPageViewControllerOptionSpineLocationKey, [NSNumber numberWithInteger:UIPageViewControllerSpineLocationMin], nil];
self.pageViewController = [[UIPageViewController alloc] initWithTransitionStyle:UIPageViewControllerTransitionStylePageCurl navigationOrientation:UIPageViewControllerNavigationOrientationHorizontal options:pageViewOptions];
BookViewController *pageOne = [self.storyboard instantiateViewControllerWithIdentifier:@"BookViewController"];
AnotherPage *pageTwo = [self.storyboard instantiateViewControllerWithIdentifier:@"AnotherPage"];
PageThree *pageThree = [self.storyboard instantiateViewControllerWithIdentifier:@"PageThree"];
self.pageViewController.delegate = self;
self.pageViewController.dataSource = self;
[self.pageViewController setViewControllers:[NSArray arrayWithObjects:pageOne, pageTwo, pageThree, nil] direction:UIPageViewControllerNavigationDirectionForward animated:NO completion:nil];
[self addChildViewController:self.pageViewController];
[self.view addSubview:self.pageViewController.view];
self.view.gestureRecognizers = self.pageViewController.gestureRecognizers;
[self.pageViewController didMoveToParentViewController:self];
Run Code Online (Sandbox Code Playgroud)
但它似乎没有用.我只看到RootViewController.
感谢所有喜欢提前帮助像我这样渴望新手的人.... :)
我遇到了一个可以轻易解决的问题,如果我可以控制数学.所以如果有人能指出我正确的方向,我很乐意欣赏这一贡献.
在食谱中,我想添加一个X数字,例如柠檬数量,每16杯.所以,当我有5杯时,我只会使用1个柠檬.当我有17杯时,我会用2个柠檬.当我有32杯时,我会添加第3个柠檬,就像每个16的柠檬一样.
什么是最简单的解决方法?