cocoa

How to get a list of ALL voices on iOS 9?

限于喜欢 提交于 2020-06-24 08:45:53
问题 The standard way to get a list of 'all' AVSpeechSynthesisVoice objects, is to ask for it: [AVSpeechSynthesisVoice speechVoices] However, this only shows a unique default voice per language-region pair. e.g. for en-US: "Language: en-US, Name: Samantha, Quality: Default", If I look in the Settings app under General → Accessibility → Speech → Voices → English I see that I have 'Siri Female (Enhanced)' selected, but that voice is not selectable from code. The full list is So the big question is:

How to test and debug Cocoa App on different version of OSx using same Mac?

我怕爱的太早我们不能终老 提交于 2020-06-23 08:27:06
问题 I made an Application using my Mac with Yosemite. On Completion of that I archived it and Then distribute to few friends, one of them have Mavericks. I faced some issues on that Mavericks System. With the occurrence of this thing, following queries raised in my mind, Can I check my application on different OSX version, without running it actually on different MACs? Can I also debug my application with different OSX Versions, using a system having single Osx? In Nutshell, I want to know, is it

WKWebView loadFileURL throws WebPageProxy::Ignoring request to load this main resource because it is outside the sandbox

心不动则不痛 提交于 2020-06-17 01:47:26
问题 I am trying to open local html file in WKWebView, but I keep getting error message: Received an unexpected URL from the web process: 'file:///Users/username/Library/Containers/dev.WebView/Data/file:/Users/username/Documents/WebView/WebView/WebView/WebContent/index.html' 2020-01-30 09:36:38.817862+0100 WebView[1679:20612] [Process] 0x101043e20 - WebPageProxy::Ignoring request to load this main resource because it is outside the sandbox This is the code that I tried: NSString *path = @"file://

Access to filesystem in a Mac App JSContext

倾然丶 夕夏残阳落幕 提交于 2020-06-17 00:56:33
问题 I am working on a Mac app that uses a JSContext for some functionality. It uses a call like this (where ctx is a JSContext ): let result: JSValue? = ctx.evaluateScript("someFunction")?.call(withArguments: [someArg1!, someArg2]) Inside the someFunction script, we need to parse a directory and determine whether it exists on the filesystem. Apple's JavaScriptCore API does not have filesystem access as far as I can tell. Is there some way I can have a function like this in swift: public static

Access to filesystem in a Mac App JSContext

喜夏-厌秋 提交于 2020-06-17 00:56:03
问题 I am working on a Mac app that uses a JSContext for some functionality. It uses a call like this (where ctx is a JSContext ): let result: JSValue? = ctx.evaluateScript("someFunction")?.call(withArguments: [someArg1!, someArg2]) Inside the someFunction script, we need to parse a directory and determine whether it exists on the filesystem. Apple's JavaScriptCore API does not have filesystem access as far as I can tell. Is there some way I can have a function like this in swift: public static

Access to filesystem in a Mac App JSContext

寵の児 提交于 2020-06-17 00:55:32
问题 I am working on a Mac app that uses a JSContext for some functionality. It uses a call like this (where ctx is a JSContext ): let result: JSValue? = ctx.evaluateScript("someFunction")?.call(withArguments: [someArg1!, someArg2]) Inside the someFunction script, we need to parse a directory and determine whether it exists on the filesystem. Apple's JavaScriptCore API does not have filesystem access as far as I can tell. Is there some way I can have a function like this in swift: public static

How to display an input box in Mac OSX using c++

故事扮演 提交于 2020-06-16 07:17:38
问题 Ok. here is the situation, I am an average c++ developer. I do not have any prior experience of working with Objective C or Cocoa for that matter. I am working on a project currently in OSX with Carbon [I am NOVICE in carbon as well], and been coding in pure C++ for 3 months. Now I am facing an issue where I have to display an input box to the user, and get some input from him, say USERNAME, having literally no knowledge of how input boxes are displayed in OSX, what are my options. I have

how to Load initial window controller from storyboard?

拜拜、爱过 提交于 2020-06-12 07:29:42
问题 I have gone through many questoions but none of them snaswers my query. I am trying to load initial window programmatically Here is what I have done. I have added main.swift as- import Cocoa private func runApplication( application: NSApplication = NSApplication.sharedApplication(), delegate: NSApplicationDelegate? = AppDelegate(), bundle: NSBundle = NSBundle.mainBundle(), nibName: String = "MainMenu", var topLevelObjects: NSArray? = nil) { setApplicationDelegate(application, delegate) }

Objective-C Blocks in C

蓝咒 提交于 2020-06-10 04:02:33
问题 While reading through the blocks conceptual overview in Apple Docs, I saw the following statement: Although blocks are available to pure C and C++, a block is also always an Objective-C object. How is this possible? I mean an Objective-C object available in pure C. I'm getting confused. 回答1: How is this possible? I mean an Objective-C object available in pure C. Matt Gallagher wrote an article that nicely explains how blocks work. In a nutshell, blocks are defined as structs that meet the

Objective-C Blocks in C

限于喜欢 提交于 2020-06-10 04:01:08
问题 While reading through the blocks conceptual overview in Apple Docs, I saw the following statement: Although blocks are available to pure C and C++, a block is also always an Objective-C object. How is this possible? I mean an Objective-C object available in pure C. I'm getting confused. 回答1: How is this possible? I mean an Objective-C object available in pure C. Matt Gallagher wrote an article that nicely explains how blocks work. In a nutshell, blocks are defined as structs that meet the