Tag: xcode7

ios 9和NSAppTransportSecurity

iOS 9有一个问题,并与服务器一起工作。 我info.plist设置: <key>NSAppTransportSecurity</key> <dict> <key>NSAllowsArbitraryLoads</key> <true/> </dict> 当你通过Xcode运行应用程序时,一切都很好。 与服务器一起工作是完美的。 但只要我停止应用程序,并尝试运行它只需点击模拟器中的图标。 networking停止工作。 当我将应用程序发送到TestFlight中的Review时,也出现同样的问题。 应用程序已安装,但networking再次停止工作。 Xcode 7.0(7a220)iOS 9.0

如何打开一个特定的视图控制器在应用程序恢复时,在didReceiveRemoteNotification上

我正在实施一个警报,我从服务器得到pushNotification,我收到完美的推送通知,它在前台模式下工作正常,但是当应用程序在后台进入时,它只获取推送通知,但不加载视图,我想加载 请检查下面的代码 func registerForPushNotifications(application: UIApplication) { let notificationSettings = UIUserNotificationSettings( forTypes: [.Badge, .Sound, .Alert], categories: nil) application.registerUserNotificationSettings(notificationSettings) } 此方法从didFinishLaunchingWithOptions调用 func application(application: UIApplication, didRegisterUserNotificationSettings notificationSettings: UIUserNotificationSettings) { if notificationSettings.types != .None { application.registerForRemoteNotifications() } } func application(application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: NSData) { let tokenChars = UnsafePointer<CChar>(deviceToken.bytes) var tokenString = "" for i in 0..<deviceToken.length { tokenString […]

Xcode 7 Git找不到远程存储库

我可以在Xcode 6.X上没有任何问题的情况下推拉这个存储库,但是它在Xcode 7上不起作用。 该设置与Xcode 6.X相同。 我试图input用户名和密码才能确认,但似乎没有意义。 我使用了正确的SSH密钥作为身份validation,但偏好设置为“无法find远程存储库”。 检出一个从来没有在Xcode 6.X上使用过的新库,在Xcode 7.0和更高版本上也有同样的问题。 我想知道是否有人有任何解决这个问题的方法。

是否有可能在Xcode 7自动UItesting中存储HTTP请求?

我一直试图在Xcode 7自动UItesting中使用像OHHTTPStubs这样的工具拦截并存根/模拟HTTP请求,但是没有运气。 下面是一个例子,我试图在UItesting文件的setUp方法中使用OHHTTPStubs来捕获任何HTTP请求: override func setUp() { super.setUp() let matcher: OHHTTPStubsTestBlock = { (request) -> Bool in return true } OHHTTPStubs.stubRequestsPassingTest(matcher) { (response) -> OHHTTPStubsResponse! in return OHHTTPStubsResponse.init() } } 有什么关于UItesting工作的方式来防止这种情况? 有没有人能够实现这一目标?

WatchOS 2(testing版5):watchAppInstalled返回false

Watch App安装在手表上,我可以在Watch上点击并运行它,但watchAppInstalled方法返回false。 此外,我只能使用Xcode 7安装Watch应用程序。如果我尝试使用Watch iOS应用程序(来自Apple)安装Watch应用程序(通过打开开关),安装完成后,Watch应用程序将立即被删除。 更新:这个错误在Xcode 7 beta 6中得到了修复

Xcode 7 UItesting,录制button变灰

我正在尝试使用Xcode 7将UItesting添加到我现有的项目中。但UItesting录制button始终呈灰色。 我在这里错过了什么? 尝试重新启动Xcode。 清理和重build项目并添加新的UItesting目标。 任何人都经历了同样的行为?

自定义解除争议iOS 8和iOS 9

我的问题是,我如何获得以下自定义展开segue在iOS 9之前版本的设备以及运行iOS 9的设备上工作? 我有一个自定义Segue显示一个视图控制器,然后有一个相应的自定义解绕Segue。 此代码在iOS 8中运行良好,并通过创buildUIStoryboardSegue的子类和实现perform方法来实现。 然后我重写我的自定义导航控制器中的以下方法: – (UIStoryboardSegue *) segueForUnwindingToViewController: (UIViewController *)toViewController fromViewController:(UIViewController *)fromViewController identifier:(NSString *)identifier { UIStoryboardSegue *segue; if([fromViewController isKindOfClass:[MyViewController class]]){ segue = [[CustomSegue alloc] initWithIdentifier:identifier source:fromViewController destination:toViewController]; //Custom Unwind Segue } else{ UIStoryboardSegue *unwindSegue = [super segueForUnwindingToViewController:toViewController fromViewController:fromViewController identifier:identifier]; //Normal Unwind Segue segue = unwindSegue; } return segue; } 在iOS 9中,不推荐使用segueForUnwindingToViewController 。 […]

如何在Xcode 7 beta 4中调用SecItemCopyMatching?

在以前的Swift版本的Xcode 6和7中,这个语法可以工作: var secureItemValue: Unmanaged<AnyObject>? let statusCode: OSStatus = SecItemCopyMatching(keychainItemQuery, &secureItemValue) if statusCode == errSecSuccess { let opaquePointer = secureItemValue?.toOpaque() let secureItemValueData = Unmanaged<NSData>.fromOpaque(opaquePointer!).takeUnretainedValue() // Use secureItemValueData… } 但是,Xcode 7 beta 4中的SecItemCopyMatching声明已经更改: OLD: func SecItemCopyMatching(_ query: CFDictionary, _ result: UnsafeMutablePointer<AnyObject?>) -> OSStatus NEW: func SecItemCopyMatching(_ query: CFDictionary!, _ result: UnsafeMutablePointer<Unmanaged<AnyObject>?>) -> OSStatus …和现在的secureItemValuetypes不匹配。 该机制之前提取结果混淆,我希望它是在某种程度上更容易与新的声明,但我不知道如何声明正确的types为secureItemValuevariables,并提取结果。

目标C中什么是非空的?

有人可以详细说明为什么在iOS 9中引入nonnull ? 例如, NSArray方法+ (instancetype)array; 现在是+ (instancetype nonnull)array; 参考: https : //developer.apple.com/library/prerelease/ios/releasenotes/General/iOS90APIDiffs/frameworks/Foundation.html 这是一个客观的C级function,这将如何影响现有的应用程序?

Xcode 7.0.1与CocaoPods应用程序编译错误退出代码1

我最近升级到最新的Xcode,并添加了一堆新的代码,并修复了所有正常的编译错误后,我得到了以下,我不知道如何纠正这个错误。 任何build议,请。 PhaseScriptExecution Copy\ Pods\ Resources /Users/dpreston10/Library/Developer/Xcode/DerivedData/Pesto-dxseswuhgbzbluabjffcnlgzjelu/Build/Intermediates/Pesto.build/Debug-iphoneos/Pesto.build/Script-EF1179D6E7811474BD220AEA.sh cd /Users/dpreston10/Dropbox/Pesto /bin/sh -c /Users/dpreston10/Library/Developer/Xcode/DerivedData/Pesto-dxseswuhgbzbluabjffcnlgzjelu/Build/Intermediates/Pesto.build/Debug-iphoneos/Pesto.build/Script-EF1179D6E7811474BD220AEA.sh /Users/dpreston10/Dropbox/Pesto/Pods/GoogleMaps/Frameworks/GoogleMaps.framework/Versions/A/Resources/GoogleMaps.bundle /Users/dpreston10/Dropbox/Pesto/Pods/JSQMessagesViewController/JSQMessagesViewController/Assets/JSQMessagesAssets.bundle ibtool –reference-external-strings-file –errors –warnings –notices –output-format human-readable-text –compile /Users/dpreston10/Library/Developer/Xcode/DerivedData/Pesto-dxseswuhgbzbluabjffcnlgzjelu/Build/Products/Debug-iphoneos/Pesto.app/JSQMessagesViewController.nib /Users/dpreston10/Dropbox/Pesto/Pods/JSQMessagesViewController/JSQMessagesViewController/Controllers/JSQMessagesViewController.xib –sdk /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.0.sdk 2015-10-03 16:35:22.011 Interface Builder Cocoa Touch Tool[12168:7780607] CoreUI: CUICatalog: couldn't get 'kMGArtworkGraphicsFeatureSetClass' from MGCopyAnswer got '{ ArtworkDeviceIdiom = pad; ArtworkDeviceScaleFactor = "-1"; DevicePerformanceMemoryClass = 1; }' 2015-10-03 16:35:22.011 Interface […]