这是关于在Facebook上发帖的第三个问题.
虽然这可能是Mac OS X的重复Facebook登录失败 - 没有为应用程序存储remote_app_id但我决定发布单独的问题,因为我们在这里有iOS而不是MAC OS.
前几天我发布了一个问题iOS 6 Facebook发布程序最终以"remote_app_id与存储的id不匹配"错误问题仍然是一样的我无法执行帖子但现在我有一个错误:
error is: Error Domain=com.apple.accounts Code=7 "The Facebook server could not fulfill this access request: remote_app_id does not match stored id." UserInfo=0xa260270 {NSLocalizedDescription=The Facebook server could not fulfill this access request: remote_app_id does not match stored id.}
您在我之前的问题中可能找到的代码.
有谁知道发生了什么?
什么是远程和存储的应用程序ID?
我在安装Xcode 6.2之后安装了额外的ios模拟器(7.1),现在模拟器名称如下所示:

如何更改名称?
我正在尝试执行一个简单的发布过程:
- (IBAction)directPostClick:(id)sender {
self.statusLabel.text = @"Waiting for authorization...";
if (self.accountStore == nil) {
self.accountStore = [[ACAccountStore alloc] init];
}
ACAccountType * facebookAccountType = [self.accountStore accountTypeWithAccountTypeIdentifier:ACAccountTypeIdentifierFacebook];
NSArray * permissions = @[@"publish_stream", @"user_checkins", @"publish_checkins", @"user_likes", @"user_videos"];
NSDictionary * dict = @{ACFacebookAppIdKey : @"My app id here", ACFacebookPermissionsKey : permissions, ACFacebookAudienceKey : ACFacebookAudienceOnlyMe};
[self.accountStore requestAccessToAccountsWithType:facebookAccountType options:dict completion:^(BOOL granted, NSError *error) {
__block NSString * statusText = nil;
if (granted) {
statusText = @"Logged in";
NSArray * accounts = [self.accountStore accountsWithAccountType:facebookAccountType];
self.facebookAccount = …Run Code Online (Sandbox Code Playgroud) 虽然,有这样一个问题Facebook错误(7)iOS 6它已经关闭,没有任何答案!在获取用户的Facebook帐户访问权限时,我遇到了错误:
error is: Error Domain=com.apple.accounts Code=7 "The Facebook server could not fulfill this access request: The proxied app is not already installed." UserInfo=0xa260270 {NSLocalizedDescription=The Facebook server could not fulfill this access request: The proxied app is not already installed.}
我正在执行这样的请求:
self.statusLabel.text = @"Waiting for authorization...";
if (self.accountStore == nil) {
self.accountStore = [[ACAccountStore alloc] init];
}
ACAccountType * facebookAccountType = [self.accountStore accountTypeWithAccountTypeIdentifier:ACAccountTypeIdentifierFacebook];
NSDictionary * dict = @{ACFacebookAppIdKey : FB_APP_ID, ACFacebookAudienceKey : ACFacebookAudienceEveryone};
[self.accountStore requestAccessToAccountsWithType:facebookAccountType options:dict completion:^(BOOL granted, …Run Code Online (Sandbox Code Playgroud) 补充: 我看到我的问题经常在没有赞成的情况下被查看,所以我决定你们没有得到你搜索的内容.重定向到有关如何处理iOS6中的方向更改的答案非常好的问题
方向变化的具体要求: 限制轮换
欢迎Upvotes :)
我已经从Master Detail模板创建了一个新项目,并尝试以横向方向启动它.如你所知
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
方法已弃用,我们必须使用
- (NSUInteger)supportedInterfaceOrientations
和/或
- (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation
这是我的代码:
- (NSUInteger)supportedInterfaceOrientations {
NSLog(@"supported called");
return UIInterfaceOrientationMaskAll;//Which is actually a default value
}
- (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation {
NSLog(@" preferred called");//This method is never called. WHY?
return UIInterfaceOrientationLandscapeRight;
}
Run Code Online (Sandbox Code Playgroud)
正如你所看到的那样,我试图在首选方法中返回横向,但它永远不会被调用.ps文档说明:
讨论系统在全屏显示视图控制器时调用此方法.当视图控制器支持两个或更多方向时,您可以实现此方法,但内容在其中一个方向中最佳.
如果视图控制器实现此方法,则在显示时,其视图将以首选方向显示(尽管稍后可以将其旋转到另一个受支持的旋转).如果未实现此方法,系统将使用状态栏的当前方向显示视图控制器.
所以,问题是:为什么永远不会调用prefferredOrientation方法?我们应该如何在不同的控制器中处理不同的方向?谢谢!PS不会将问题标记为重复.我调查了所有类似的问题,他们没有我的答案.
增加:您可以在github ios6rotations上访问此项目
很抱歉在iOS 6中询问有关屏幕旋转的问题,但这确实是一个痛苦的问题.我仍然无法完全理解它 - 由于某种原因,它在某些情况下表现不同.
我的测试应用程序中有以下简单的视图层次结构:

我想要实现的是 - 将蓝色控制器仅保留在风景中,红色控制器仅保留在纵向中.
我有一个UINavigationController的子类,里面有这样的代码:
@implementation CustomNavController
- (BOOL)shouldAutorotate
{
return [[self.viewControllers lastObject] shouldAutorotate];
}
- (NSUInteger)supportedInterfaceOrientations
{
return [[self.viewControllers lastObject] supportedInterfaceOrientations];
}
- (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation {
return [[self.viewControllers lastObject] preferredInterfaceOrientationForPresentation];
}
@end
Run Code Online (Sandbox Code Playgroud)
在我的蓝色控制器中我实现了这个:
- (BOOL)shouldAutorotate {
return YES;
}
- (NSUInteger)supportedInterfaceOrientations {
return UIInterfaceOrientationMaskLandscape;
}
Run Code Online (Sandbox Code Playgroud)
而在红色控制器这:
- (BOOL)shouldAutorotate {
return YES;
}
- (NSUInteger)supportedInterfaceOrientations {
return UIInterfaceOrientationMaskPortrait;
}
Run Code Online (Sandbox Code Playgroud)
现在我有以下行为:
PS所有我的旋转方法(上面发布的)都被正常调用.(顺便说一下为什么这些方法每次屏幕转换被调用这么多次 - 5-6次)
- (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation 没有被推动调用
所有(portraitUpsideDown除外)方向都包含在plist中.
问题是 - …
我正在尝试将Facebook共享程序集成到我的应用程序中.我这样使用UIActivityViewController:
NSArray * activityItems = @[self.imgView.image, self.txtField.text];
UIActivityViewController * activityVC = [[UIActivityViewController alloc] initWithActivityItems:activityItems applicationActivities:nil];
[self presentViewController:activityVC animated:YES completion:nil];
Run Code Online (Sandbox Code Playgroud)
直到现在一切都运转良好.但我遇到了这样的问题 - 当我点击Facebook图标并进入Facebook共享屏幕时,会出现alertView:

所以问题是 - 当我点击设置我的控制器刚被解雇,没有任何反应.对于Twitter,一切运行良好 - 当点击"设置"按钮时,我的应用程序将进入后台并打开"设置".为什么这对Facebook无效?任何帮助都会得到满足.
增加:使用SLComposeViewController导致相同的行为 - 设置无法打开
我需要允许在两个设备之间通过蓝牙进行数据交换的功能.我知道GKPeerPickerController用于此目的.但是自iOS 7以来,这个类已被弃用.互联网搜索和文档都没有说明要使用的内容(通常如此).有什么建议?
请告诉我两个UIButton方法之间的区别是什么:
- (void)setBackgroundImage:(UIImage *)image forState:(UIControlState)state
Run Code Online (Sandbox Code Playgroud)
和
- (void)setImage:(UIImage *)image forState:(UIControlState)state
Run Code Online (Sandbox Code Playgroud)
Apple文档没有提及它.
请告诉我什么时候使用这种方法?
- (void)saveAccount:(ACAccount *)account withCompletionHandler:(ACAccountStoreSaveCompletionHandler)completionHandler
据我所知,我们可以通过OAuth访问该帐户,但我们无法获得用户的凭据.那么我们如何创建一个帐户呢?我发现ACAccount只有一种创建方法:
- (id)initWithAccountType:(ACAccountType *)type
当我们以这种方式创建帐户时会发生什么?我们现在可以保存吗?