ios8

How do I tell iOS to download a file from iCloud Drive and get progress feedback

三世轮回 提交于 2019-12-18 11:59:31
问题 I am using the UIDocumentPicker to select a file but if it's large it can take a while to open and that is not a particularly good experience for users. I have looked at the iCloud programming guide from Apple and I cannot seem to figure out how to actually download a file and get some progress feedback, the documentation is just too vague. I know I am supposed to do something with NSMetadataItems, but there isn't much explaining actually how to get one and use it. Can someone please explain

Mysterious crash on iOS 8

我只是一个虾纸丫 提交于 2019-12-18 11:58:18
问题 I'm getting a lot of crash reports on iOS 8 with this stack trace: Date/Time: 2014-09-17T20:26:15Z OS Version: iPhone OS 8.0 (12A365) Report Version: 104 Exception Type: SIGSEGV Exception Codes: SEGV_ACCERR at 0x1 Crashed Thread: 0 Thread 0 Crashed: 0 libGPUSupportMercury.dylib 0x2a4f88fe gldGetBufferAllocationIdentifiers + 194 1 libGPUSupportMercury.dylib 0x2a4f93cb gpusSubmitDataBuffers + 108 2 libGPUSupportMercury.dylib 0x2a4f9249 gldCreateContext + 206 3 GLEngine 0x2613c93b

Send location updates every 30 minutes in Swift

自闭症网瘾萝莉.ら 提交于 2019-12-18 11:48:25
问题 I have background mode on for location services and aiming to send out location (latitude and longitude) to the server every 30 minutes. For now I am printing the same in the console. It seems to work for a while but I am wondering how do I work with NSTimer in this case. And from where should I be calling it? import UIKit import CoreLocation @UIApplicationMain class AppDelegate: UIResponder, UIApplicationDelegate, CLLocationManagerDelegate { var window: UIWindow? var locationManager =

Convert NSArray to Swift Array<T>

筅森魡賤 提交于 2019-12-18 11:44:14
问题 In CoreData I have defined an ordered to-many relationship. This relationship is defined in Swift like this: @NSManaged var types : NSMutableArray However, to use Swift at it's best, I want to use a normal Swift array like Type[] . However, CoreData forces me to use NS(Mutable)Array . How can I type-cast / convert the NSArray to Array<Type>[] ? Apparently the confusion arises from the following error: let array = obj.types as T[] // Cannot convert expression's type 'Node[]' to type '$T2'

Sizes and Naming of Launch Image for iPhone app in iOS8

笑着哭i 提交于 2019-12-18 11:35:38
问题 What are sizes/naming of the launch images used for iPhone app in iOS ? 回答1: Size Conventions iPhone3g : 320 x 480 iPhone4/4s : 640 x 960 iPhone5/5s : 640 x 1136 iPhone6 : 750 x 1334 iPhone 6plus : 1242 x 2208 Naming Conventions For developers who don't wan't to use 'Asset Catalogs', they need to give specific names to launch images iPhone3g : 'Default.png' iPhone4/4s : 'Default@2x.png' iPhone5/5s : 'Default-568h@2x.png' iPhone6 : 'Default-667h@2x.png' iPhone6plus : 'Default-736h@3x.png' For

AssetsLibrary framework broken on iOS 8

删除回忆录丶 提交于 2019-12-18 11:31:32
问题 I have run into an issue on iOS 8 with the Assets Library framework that appears to be a bug in iOS 8. If I create an album called 'MyMedia' and then delete it, then when I try to create the album again, this chunk of code below returns 'nil' indicating that the album 'MyMedia' exists even though it does not because I deleted it using the 'Photos' app. __block ALAssetsGroup *myGroup = nil; __block BOOL addAssetDone = false; NSString *albumName = @"MyMedia"; [assetsLib

Optimized for iPhone 6 info text in App Store

自古美人都是妖i 提交于 2019-12-18 11:29:32
问题 I've updated my "old" Objective-C app to use the new storyboard with size classes, set the deployment target to iOS 8 and uploaded the new binary to the App Store. Still, the App Store doesn't show the text "this app is optimized for iPhone 6 and 6 plus". The text only mentions iPhone 5S and everything below. What am I supposed to do in order to get the app iPhone 6 approved? 回答1: The solution was to add @3x versions for all used images and using the new size classes. You notice the app from

iOS 8 - UIPopoverPresentationController moving popover

雨燕双飞 提交于 2019-12-18 11:12:22
问题 I am looking for an effective way to re-position a popover using the new uipopoverpresentationcontroller. I have succesfully presented the popover, and now I want to move it without dismissing and presenting again. I am having trouble using the function: (void)popoverPresentationController:(UIPopoverPresentationController *)popoverPresentationController willRepositionPopoverToRect:(inout CGRect *)rect inView:(inout UIView **)view I know it's early in the game, but it anyone has an example of

Unable to determine simulator device to boot. - Xcode

给你一囗甜甜゛ 提交于 2019-12-18 10:58:34
问题 I just downloaded Xcode 6 & played with it a bit. After switching back to previous version of Xcode and running in simulator, I keep getting this error. Unable to determine simulator device to boot. How do we resolve this? Thanks in advance. 回答1: Make sure you have only one iOS Simulator instance running in the Dock. 回答2: There was a simple answer to this for me: Open the simulator via Xcode -> Open Developer Tool -> iOS simulator (even if it can't launch, the app will be open). With the

Swift Error: Variable used within its own initial value

大憨熊 提交于 2019-12-18 10:58:13
问题 When I'm initializing an instance of an entity I'm getting the error Variable used within its own initial value . Here is the code throwing the error: class func buildWordDefinition (word:String, language:Language, root:TBXMLElement) -> WordDefinition { let word = WordDefinition(word: word, language: language) The error points at the word variable. Here is the WordDefinition class: class WordDefinition { let word: String let language: Language init(word: String, language:Language) { self.word