小编Ker*_*ros的帖子

解析无效会话令牌(代码:209,版本:1.7.1)

我刚刚更新了我的Parse和Facebook SDK(分别为1.7.1和4.0) - 两者都是我可能添加的工作的绝对痛苦!

但是,当我尝试使用Facebook登录时,我现在收到209错误.

这是我的代码示例:

- (void)loginWithFacebook:(HMSuccessBlock)completion{
NSArray *permissionsArray = @[@"user_about_me",@"user_location",@"user_friends",@"user_relationships"];

// Login PFUser using Facebook

[PFFacebookUtils logInInBackgroundWithReadPermissions:permissionsArray block:^(PFUser *user, NSError *error) {
    if (!user) {
        NSLog(@"Uh oh. The user cancelled the Facebook login.");
        UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Log In Error"
                                                        message:error.localizedDescription
                                                       delegate:nil
                                              cancelButtonTitle:nil
                                              otherButtonTitles:@"Dismiss", nil];
        [alert show];
        completion(NO, error);

    } else if (user.isNew) {
        NSLog(@"User signed up and logged in through Facebook!");
        if (completion) {
            completion(YES, nil);
        }
    } else {
        NSLog(@"User logged in through Facebook!");
           completion(YES, …
Run Code Online (Sandbox Code Playgroud)

facebook objective-c ios parse-platform facebook-sdk-4.0

31
推荐指数
3
解决办法
2万
查看次数

iOS - 双击uibutton

我有一个按钮,我正在测试它上面的水龙头,一个水龙头就可以改变背景颜色,两个水龙头可以换另一种颜色,三个水龙头再次点亮另一种颜色.代码是:

- (IBAction) button 
{
    UITapGestureRecognizer *tapOnce = [[UITapGestureRecognizer alloc] initWithTarget:self  action:@selector(tapOnce:)];
    UITapGestureRecognizer *tapTwice = [[UITapGestureRecognizer alloc] initWithTarget:self  action:@selector(tapTwice:)];
    UITapGestureRecognizer *tapTrice = [[UITapGestureRecognizer alloc] initWithTarget:self  action:@selector(tapTrice:)];

    tapOnce.numberOfTapsRequired  = 1;
    tapTwice.numberOfTapsRequired = 2;
    tapTrice.numberOfTapsRequired = 3;

    //stops tapOnce from overriding tapTwice
    [tapOnce requireGestureRecognizerToFail:tapTwice];
    [tapTwice requireGestureRecognizerToFail:tapTrice];

    //then need to add the gesture recogniser to a view - this will be the view that recognises the gesture
    [self.view addGestureRecognizer:tapOnce];
    [self.view addGestureRecognizer:tapTwice];
    [self.view addGestureRecognizer:tapTrice];
}

- (void)tapOnce:(UIGestureRecognizer *)gesture
{ 
    self.view.backgroundColor = [UIColor redColor]; 
} …
Run Code Online (Sandbox Code Playgroud)

xcode objective-c button gesture ios

17
推荐指数
1
解决办法
9529
查看次数

重置Facebook令牌参考 - Facebook SDK 4.0

我之前使用以下内容清除并重置Facebook访问令牌

[FBSession.activeSession closeAndClearTokenInformation];
Run Code Online (Sandbox Code Playgroud)

由于更新到4.0,这不再有效.FBSession.activeSession已改为[FBSDKAccessToken currentAccessToken].

但是我找不到与最新版本一起使用的最新版本的closeAndClearTokenInformation.有什么建议?

objective-c ios facebook-sdk-4.0

14
推荐指数
2
解决办法
9267
查看次数

Xcode中的存档显示在"其他项目"下

我正在尝试使用存档选项将应用程序提交到iTunes Connect.构建通用iOS设备时,它通常显示在管理器中的iOS应用程序下.但是,现在它显示在"其他项目"下没有版本和想法更整洁.

我最后一次构建是10月28日,除了添加ADAL Xcode项目(作为项目)和我执行的小错误修复之外,我不知道有什么可能导致这种情况.

之所以我将ADAL Xcode项目添加到我的应用程序项目中,只是在包含Framework时它在模拟器中不起作用.添加框架可以正确构建它.

但即使是现在,当删除ADAL项目并添加旧的预构建框架时,它仍然会在其他项目下结束.什么可能导致这个?我正在使用Xcode 9.1.

iphone xcode ios

12
推荐指数
5
解决办法
3517
查看次数

iOS WKWebView Swift javascript启用

我正在尝试开发一个简单的应用程序来浏览我的网站.但是我的网站包含一些JavaScript,但它没有成功显示我的网站.

在过去开发与Android相同的应用程序,不得不像这样激活:

webSettings.setJavaScriptEnabled(true);
Run Code Online (Sandbox Code Playgroud)

这个目前我的代码我只是错过了启用javascript的选项,如果有人可以提供帮助,我将非常感激

import WebKit

class ViewController: UIViewController {

  @IBOutlet weak var webView: WKWebView!

  override func viewDidLoad() {
    super.viewDidLoad()
    let url = URL(string: "http://132.148.136.31:8082")
    let urlRequest = URLRequest(url: url!)

    webView.load(urlRequest)
  }
}
Run Code Online (Sandbox Code Playgroud)

view ios web swift wkwebview

7
推荐指数
3
解决办法
2万
查看次数

更新到Xcode 11后,Swift WKWebView“获取断言时出错”

感谢您为解决以下问题所提供的帮助。我更新到Xcode 11后出现此问题。

WKWebView将打开一个包含嵌入式Vimeo视频的网页。该页面将加载并显示嵌入式播放器。当我点击视频播放时,在控制台中收到以下错误:

[断言]获取断言时出错:{userInfo = {RBSAssertionAttribute =; }}

[ProcessSuspension] 0x1056fde38-ProcessAssertion()PID 1887无法获取具有PID 1887的过程的断言2019-09-22 11:15:04.570119-0700 testWeb [1887:362082] [ProcessSuspension] 0x1056fde38-ProcessAssertion :: processAssertionWasInvalidated()2019- 09-22 11:15:04.576732-0700 testWeb [1887:362143] [assertion]获取断言时出错:{userInfo = {RBSAssertionAttribute =; }}

[ProcessSuspension] 0x1056fde88-ProcessAssertion()PID 1887无法获取具有PID 1890的过程的断言2019-09-22 11:15:04.577137-0700 testWeb [1887:362082] [ProcessSuspension] 0x1056fde88-ProcessAssertion :: processAssertionWasInvalidated()2019- 09-22 11:15:05.261258-0700 testWeb [1887:362150] [plugin] AddInstanceForFactory:没有为ID F8BB1C28-BAE8-11D6-9C31-00039315CD46注册的工厂

它在Xcode 11上运行,并且问题出现在模拟器以及运行iOS 13和iOS 12的设备上。

ios swift wkwebview

7
推荐指数
1
解决办法
1535
查看次数

如何在uitextfield iOS中滚动文本

我需要在里面滚动数据,UITextfield以便通过滚动可以看到更长宽度的文本.

有人可以回复我来解决这个问题吗?

iphone objective-c ios

6
推荐指数
1
解决办法
1368
查看次数

Codeign在High Sierra中返回了errSecInternalComponent

我尝试使用以下方法进行编码:

/usr/bin/codesign -f -s $IDENTITY --keychain $KEYCHAIN --entitlements $ENTITLEMENTS Payload/Test.app
Run Code Online (Sandbox Code Playgroud)

但是我收到了一个errSecInternalComponent错误.

code-signing code-signing-certificate codesign ios macos-high-sierra

6
推荐指数
1
解决办法
4261
查看次数

"UIApplicationMain"属性不能在包含顶级代码的模块中使用

所有的suden我在我的AppDelegate中得到了这个错误:

"UIApplicationMain"属性不能在包含顶级代码的模块中使用

在它所说的行: @UIApplicationMain

现在项目无法建立.我正在使用Swift和Xcode 6.2.我尝试删除派生数据文件夹,甚至使用最新的Xcode 6.3 beta,这是我第一次创建项目的地方.

我不知道发生了什么,我到处搜寻都没有运气.谢谢

xcode ios appdelegate swift

5
推荐指数
3
解决办法
3536
查看次数

Swift 的组合框架的问题CombineLatest

我浏览了 WWDC 的“Combine 简介”视频,其中提到每当发布者值更新时,CombineLatest 就会被调用并更新。但我创建的片段工作起来很奇怪。

class Mango {
    var enableButton = false
    @Published var userName = "admin"
    @Published var password = "poweruser"
    @Published var passwordAgain = "poweruser"
    var validatePassword: AnyCancellable {
        Publishers.CombineLatest($password, $passwordAgain).map { (password, reenterpass) -> String? in
            print("Is Password Same to \(password)? :", password == reenterpass)
            guard password == reenterpass else { return nil }
            return password
        }.eraseToAnyPublisher()
            .map { (str) -> Bool in
            print("In Map", str != nil)
            guard str != nil else { return false } …
Run Code Online (Sandbox Code Playgroud)

ios swift swift5

5
推荐指数
1
解决办法
4861
查看次数