标签: ios9

在iOS 8,iOS 9,iOS 10和iOS 11上UITabBar的高度是多少?

UITabBar的高度似乎在iOS 7和8/9/10/11之间发生了变化.我正在向其他人发布这个问题,以便轻松找到答案.

那么:iPhone和iPad上iOS 8/9/10/11上UITabBar的高度是多少?

cocoa-touch uitabbar ios ios8 ios9

52
推荐指数
3
解决办法
4万
查看次数

Swift 2/iOS 9 - 找不到libz.dylib

我在我的新Swift 2.0项目中使用谷歌的一些外部代码,在早期版本中需要"libz.dylib".更新到新的XCode /新SDK后.

XCode现在无法导入libz.dylib并抛出一些错误

架构i386的未定义符号:"_ deflate",引用自:+ [GAICompressionUtil gai_dataByCompressingBytes:length:compressionLevel:mode:]在libGoogleAnalyticsServices.a(GAICompressionUtil.o)"_ deflateEnd"中,引自:+ [GAICompressionUtil gai_dataByCompressingBytes:length:compressionLevel: mode:]在libGoogleAnalyticsServices.a(GAICompressionUtil.o)" deflateInit2 "中,引自:+ [GAICompressionUtil gai_dataByCompressingBytes:length:compressionLevel:mode:]在libGoogleAnalyticsServices.a(GAICompressionUtil.o)"_inflate"中,引自:+ [GAICompressionUtil在libGoogleAnalyticsServices.a(GAICompressionUtil.o)"_inflateEnd"中的gai_dataByInflatingBytes:length:isRawData:],引自:+ [GAICompressionUtil gai_dataByInflatingBytes:length:isRawData:]在libGoogleAnalyticsServices.a(GAICompressionUtil.o)" inflateInit2 "中,引用自:+ libGoogleAnalyticsServices.a中的[GAICompressionUtil gai_dataByInflatingBytes:length:isRawData:](GAICompressionUtil.o)ld:symbol(s)找不到架构i386 clang:错误:链接器命令失败,退出代码为1(使用-v查看调用)

在查看"构建阶段"设置中的可用包时,我可以找到"libz.tbd",它似乎是libz.dylib的替代品.导入此lib时,链接器错误保持不变,但我收到此额外警告:

警告:正在跳过文件'/Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator9.0.sdk/usr/lib/libz.tbd'(意外文件类型'text'in框架和库构建阶段)

知道该怎么办?

google-analytics swift google-analytics-sdk ios9 swift2

52
推荐指数
3
解决办法
4万
查看次数

iOS9中的App Transport Security和IP地址

我使用在我的开发箱上运行的本地服务器开发我的iOS应用程序.在设备上进行测试时,我通过IP地址直接连接,该地址是通过HTTP而不是HTTPS(因此我不需要在开发过程中处理自签名证书,设备甚至不喜欢这样做).

我认为这就足够了:

在此输入图像描述

但是,如果没有添加也无法让它工作NSAllowsArbitraryLoads = YES,AKA:

在此输入图像描述

现在,我将不得不记得在滚动生产版本时删除它,而不是在开发期间删除... arg.是否应该NSExceptionDomains使用IP地址,如果没有,还有什么我可以做而不启用NSAllowsArbitraryLoads

ios9

52
推荐指数
3
解决办法
1万
查看次数

在iOS 9中,本地Facebook应用程序无法通过Facebook登录打开

我已经将iPhone 6 plus更新到iOS 9测试版,并试图执行Facebook登录,但每次使用Facebook登录表单呈现UIWebView.

我有Facebook sdk

FB_IOS_SDK_VERSION_STRING @"3.24.0"
FB_IOS_SDK_TARGET_PLATFORM_VERSION @"v2.2"
Run Code Online (Sandbox Code Playgroud)

我正在使用以下方法来执行Facebook登录

    NSArray *permissions = @[@"email",@"user_birthday",@"public_profile"];


     FBSessionStateHandler completionHandler = ^(FBSession *session, FBSessionState status, NSError *error) {
         [self sessionStateChanged:session state:status error:error];
     };

     if ([FBSession activeSession].state == FBSessionStateCreatedTokenLoaded) {
     // we have a cached token, so open the session
         [[FBSession activeSession]openWithBehavior:FBSessionLoginBehaviorUseSystemAccountIfPresent
                                 fromViewController:nil
                                  completionHandler:completionHandler];
     } else {

     [self clearAllUserInfo];
    [[NSURLCache sharedURLCache] removeAllCachedResponses];

     // create a new facebook session
     FBSession *fbSession = [[FBSession alloc] initWithPermissions:permissions];
     [FBSession setActiveSession:fbSession];
     [fbSession openWithBehavior:FBSessionLoginBehaviorUseSystemAccountIfPresent
              fromViewController:nil
               completionHandler:completionHandler];
     }
Run Code Online (Sandbox Code Playgroud)

我在plist文件下面进行了以下设置

    <key>LSApplicationQueriesSchemes</key>
    <array> …
Run Code Online (Sandbox Code Playgroud)

facebook objective-c ios facebook-login ios9

52
推荐指数
4
解决办法
4万
查看次数

如何在iOS 9中使用新的旧金山字体?

iOS 9之前引用我们使用fontWithName的字体UIFont:

[UIFont fontWithName:@"HelveticaNeue" size:18]
Run Code Online (Sandbox Code Playgroud)

现在我们转向iOS 9.如何以相同的方式引用新的旧金山字体

我们可以使用它systemFontOfSizeUIFont,但如何引用其他款式比普通?例如,如何使用San Francisco MediumSan Francisco Light字体?

fonts ios ios9

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

iOS 9 UITableView分隔符插入(显着的左边距)

我有之间的分隔符的问题UITableViewCell以s UITableViewiOS 9.它们具有显着的左边距.我已经有了删除引入的间距的代码,iOS 8但它无法使用iOS 9.看起来他们添加了别的东西.我想它可能与layoutMarginsGuide有关,但我还没想到它.有没有人有类似的问题,并找到了解决方案?

uitableview uikit ios ios9 xcode7

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

OSStatus错误代码-34018

SecItemCopyMatching用来访问iOS钥匙串.大约一百次,我-34018在从后台重新启动应用程序后立即获得结果代码.文件说明:

Keychain Services的指定错误空间是不连续的:-25240到-25279和-25290到-25329.Keychain Item Services也可以返回noErr(0)或paramErr(-50)或CSSM结果代码

所以它似乎-34018是一个'CSSM结果代码'.我已按照建议的链接但找不到结果代码.

它的-34018结果代码?如何获得更可靠的钥匙串访问?

- (NSData *)getKeychainData:(NSString *)key
{
    NSDictionary *query = @{
        (__bridge id)kSecClass:(__bridge id)kSecClassGenericPassword,
        (__bridge id)kSecAttrService:SEC_ATTR_SERVICE,
        (__bridge id)kSecAttrAccount:key,
        (__bridge id)kSecReturnData:@YES
    };

    CFDataRef result = nil;

    OSStatus status = SecItemCopyMatching((__bridge CFDictionaryRef)query, (CFTypeRef *)&result);

    if(status == errSecItemNotFound) {
        return nil;
    }

    if(status == noErr) {
        return CFBridgingRelease(result);
    } else {
        [self logError:[NSString stringWithFormat:@"SecItemCopyMatching status %d", (int)status] :nil];
        return nil;
    }
}
Run Code Online (Sandbox Code Playgroud)

objective-c keychain ios ios9

48
推荐指数
2
解决办法
5763
查看次数

造成这种情况的原因是:无法从switch语句跳转到此case标签

这是一个switch语句,我收到错误:

        switch (transaction.transactionState) {

        case SKPaymentTransactionStatePurchasing:

            // show wait view here
            statusLabel.text = @"Processing...";
            break;

        case SKPaymentTransactionStatePurchased:

            [[SKPaymentQueue defaultQueue] finishTransaction:transaction];

            // remove wait view and unlock iClooud Syncing
            statusLabel.text = @"Done!";

            NSError *error = nil;
            [SFHFKeychainUtils storeUsername:@"IAPNoob01" andPassword:@"whatever" forServiceName: kStoredData updateExisting:YES error:&error];

            // apply purchase action  - hide lock overlay and
            [oStockLock setBackgroundImage:nil forState:UIControlStateNormal];

            // do other thing to enable the features

            break;

        case SKPaymentTransactionStateRestored:

            [[SKPaymentQueue defaultQueue] finishTransaction:transaction];

            // remove wait view here
            statusLabel.text = @"";
            break;

        case SKPaymentTransactionStateFailed:

            if …
Run Code Online (Sandbox Code Playgroud)

objective-c switch-statement ios9

48
推荐指数
1
解决办法
3万
查看次数

在iOS 9中,不推荐使用sendAsynchronousRequest,如何修改要修复的代码

以下是我的代码我遇到的问题:

func parseFeedForRequest(request: NSURLRequest, callback: (feed: RSSFeed?, error: NSError?) -> Void)
{
    NSURLConnection.sendAsynchronousRequest(request, queue: NSOperationQueue.mainQueue()) { (response, data, error) -> Void in

        if ((error) != nil)
        {
            callback(feed: nil, error: error)
        }
        else
        {
            self.callbackClosure = callback

            let parser : NSXMLParser = NSXMLParser(data: data!)
            parser.delegate = self
            parser.shouldResolveExternalEntities = false
            parser.parse()
        }
    }
}
Run Code Online (Sandbox Code Playgroud)

现在,从iOS 9开始,这已被弃用,并告诉我使用dataTaskWithRequest.有人可以帮我用dataTask更改sendAsync,我不知道怎么做.

ios swift ios9

47
推荐指数
4
解决办法
4万
查看次数

未定义UICollectionViewFlowLayout的行为,因为单元格宽度大于collectionView宽度

2015-08-18 16:07:51.523示例[16070:269647]未定义UICollectionViewFlowLayout的行为,因为:2015-08-18 16:07:51.523
示例[16070:269647]项目宽度必须小于UICollectionView的宽度减去左边和右边的值,减去左边和右边的内容值.
2015-08-18 16:07:51.524示例[16070:269647]相关的UICollectionViewFlowLayout实例是,并附加到; 动画= {position =; bounds.origin =; bounds.size =; }; layer =; contentOffset:{0,0}; contentSize:{1024,770}>集合视图布局:.2015-08-18 16:07:51.524示例[16070:269647]在UICollectionViewFlowLayoutBreakForInvalidSizes上创建一个符号断点,以便在调试器中捕获它.

这就是我得到的,我所做的是

func collectionView(collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAtIndexPath indexPath: NSIndexPath) -> CGSize {
        return CGSizeMake(self.collectionView!.frame.size.width - 20, 66)
    }
Run Code Online (Sandbox Code Playgroud)

当我从横向旋转到纵向时,控制台仅在iOS 9中显示此错误消息,是否有人知道这是怎么回事?如果有解决方法?

截图

uicollectionview uicollectionviewcell uicollectionviewlayout ios9 xcode7-beta5

47
推荐指数
9
解决办法
5万
查看次数