Search results for

file uri scheme

78,591 results found

Post

Replies

Boosts

Views

Activity

NSURLSession not working in Xcode 7 the same code works in Xcode6
Hi All,I have having some issue with using NSURLSession in Xcode7 and Swift2. For some reason I keep getting NSURLErrordomain error but the same codeis working on Xcode6 with swift 1.2.let baseURL = NSURL(string: https://itunes.apple.com/search?term=one%20republic) let downloadTask = session.downloadTaskWithURL(baseURL!, completionHandler: { (location, response, error) -> Void in if(error == nil){ let objectData = NSData(contentsOfURL: location!) let tmpData :NSString = NSString(data: objectData!, encoding: NSUTF8StringEncoding)! print(success) } else { print(Failed) } }) downloadTask!.resume()https://drive.google.com/file/d/0B-bZj242s5iAX2Z0bzVETjE3akk/view?usp=sharingPlease let me know if I am missing something here.
3
0
13k
Jun ’15
Reply to Swift 2.0 - GKPlayer : properties nilable
From a Swift perspective, these methods can potentilly return nil because that's how they were declared (as nullable) in the obj-c header.To get an answer about why they were declared that way, you will probably need to get the attention of an Apple engineer that works on GameKit.The Game Center section is probably a better bet https://forums.developer.apple.com/community/graphics-and-games/game-center,or file a bug report about GameKit requesting that the GKPlayer nullability annotations be fixed or the methods be properly documented to explain in what circumstances they might return nil.
Topic: Programming Languages SubTopic: Swift Tags:
Jun ’15
Hide file on external device "allowed"?
I wrote an app which handles external storage devices, to work with this devices i create a plist file on the device.My question is, if im allowed (by means of a mac app store review ) to hide this files with a preceding dot to not distract the user.I think it is nice if there isnt an (for most people) unknown file on the device and i think it will reduce the risk of people deleting the file.On the other hand this file will stay there unnoticed even if the user isnt using my app anymore.Typical size will be 1kb...Thanks!
0
0
64
Jun ’15
Reply to Any news on reflection in Swift 2.0?
Sorry, meant to come back to this thread days ago...As others have noted, Swift 2 doesn't seem to support what you want it to do. I see a workaround, though... There's still boilerplate code, but it seems less error-prone to meFirst, we need a way to iterate over the enum cases (and provide their default values):class StoryBookStateGenerator : AnyGenerator<StoryBookState> { var optcase:StoryBookState? = nil override func next() -> Generator.Element? { if let cas = optcase { switch cas { case .Welcome: optcase = .Praise(nil, nil) case .Praise: optcase = .InvitationToRepeat(nil, nil) case .InvitationToRepeat: optcase = .TurnToNextPage(nil) case .TurnToNextPage: optcase = .End case .End: optcase = nil } } else { optcase = .Welcome(nil) } return optcase } }Second, we need a way to parse the source code and extract the case labels. For some reason, I couldn't get String(contentsOfFile) to work. Fortunately, someone on stackoverflow was kind enough to post a class that'll read each line of a file
Topic: Programming Languages SubTopic: Swift Tags:
Jun ’15
No Audio
Hi All,I've read the other comments but haven't figured this out. Is it possible to play audio to the watch speaker as of beta 1? I can get the mp3 file to tell me I need an external bluetooth speeker on the simulator but my watch just crashes. I just can't figure it out and it looks like others can't fix it either. Then I see a hack for nanoFlappy that plays all audio to the watch speaker...***? I have tried the code on other post but it just doesn't work. So if anyone has code (Swift) that actually works, I would appreciate seeing it...Thanks.
6
0
606
Jun ’15
Upload from Xcode crashing
HelloYesterday I successfully uploaded a build to iTunes Connect from inside XCode Version 6.3.2 (6D2105), but today, every time I try to upload XCode crashes.I have tried cleaning, rebuilding, restarting my laptop.I am starting to think this is a bug in Xcode or some kind of change between how Xcode & the store interact to upload my build.Has anyone else seen this or something like it?Are there any work arounds to upload a build to the store?Thank youRayCRASH LOG:Process: Xcode [952]Path: /Applications/Xcode.app/Contents/MacOS/XcodeIdentifier: com.apple.dt.XcodeVersion: 6.3.2 (7718)Build Info: IDEFrameworks-7718000000000000~2App Item ID: 497799835App External ID: 812404257Code Type: X86-64 (Native)Parent Process: ??? [1]Responsible: Xcode [952]User ID: 501Date/Time: 2015-06-17 18:34:32.916 -0700OS Version: Mac OS X 10.10.3 (14D136)Report Version: 11Anonymous UUID: 37388F5A-50D7-FA67-C88B-B59927DE7E82Time Awake Since Boot: 620 secondsCrashed Thread: 17 Dispatch queue: NSOperationQueue 0x7fe241ba0b90 :: NS
6
0
1k
Jun ’15