cocoa

Progress Bar in Cocoa

时光总嘲笑我的痴心妄想 提交于 2020-01-15 11:01:49
问题 I have a very simple application that contains a WebView. This webview loads an HTML5 app and it takes some time while the content is being built inside the webview. I would like to show a progress bar until the content finishes loading and show the webview when the content is ready. It takes roughly 10 seconds. ?? 回答1: Swift 2.2 override func viewDidLoad() { super.viewDidLoad() webView.frameLoadDelegate = self webView.addObserver(self, forKeyPath: "estimatedProgress", options: .New, context:

Progress Bar in Cocoa

北城余情 提交于 2020-01-15 11:00:12
问题 I have a very simple application that contains a WebView. This webview loads an HTML5 app and it takes some time while the content is being built inside the webview. I would like to show a progress bar until the content finishes loading and show the webview when the content is ready. It takes roughly 10 seconds. ?? 回答1: Swift 2.2 override func viewDidLoad() { super.viewDidLoad() webView.frameLoadDelegate = self webView.addObserver(self, forKeyPath: "estimatedProgress", options: .New, context:

UIView drawRect; class variables out of scope

人走茶凉 提交于 2020-01-15 10:54:53
问题 Short & sweet version of my last question in light of new information. I have a UIVIew with an init and a drawrect method (and another thread and a bunch of other stuff, but I'll keep it short & sweet). All of the class variables that I alloc and init in the -(id)init method are out of scope/nil/0x0 in the drawRect method, and I am unable to access them. For example; In the interface: NSObject* fred; In the implementation: -(id)init { if(self == [super init]) { fred = [[NSObject alloc] init];

UIView drawRect; class variables out of scope

大城市里の小女人 提交于 2020-01-15 10:52:31
问题 Short & sweet version of my last question in light of new information. I have a UIVIew with an init and a drawrect method (and another thread and a bunch of other stuff, but I'll keep it short & sweet). All of the class variables that I alloc and init in the -(id)init method are out of scope/nil/0x0 in the drawRect method, and I am unable to access them. For example; In the interface: NSObject* fred; In the implementation: -(id)init { if(self == [super init]) { fred = [[NSObject alloc] init];

How to define the WebPluginMIMETypesFilename in the plist of a safari webplugin project?

て烟熏妆下的殇ゞ 提交于 2020-01-15 10:08:54
问题 I want to know the defination of WebPluginMIMETypesFilename, if my project is SafariPlugins. target extension is webplugin, My WebPluginMIMETypesFilename is com.SafariPlugIns.webplugin.plist? and what is the webPluginMIMETYpes, I just know when safari lunch , it will test the webplugin if have the webPluginMIMETYpes or not. and then load the plugin , but it is what to do ? and it's definition? and another question is : if I define the the Principal class of plist my plugin class name

Recompiling old cocoa app without sandbox

这一生的挚爱 提交于 2020-01-15 09:42:12
问题 I have a couple of Cocoa apps that are distributed privately and do not use the app store. They haven't been touched for at least a year. I need to make some changes. They don't work properly with Apple's sandbox. I've tried to turn off sandboxing in Xcode (9.4.1), but the absence of an entitlements file seems to be interpreted as sandboxed. I've noticed that command line applications don't have this problem (yet). How can I get the old behavior back? In the past I signed the apps to minimize

Recompiling old cocoa app without sandbox

倖福魔咒の 提交于 2020-01-15 09:42:01
问题 I have a couple of Cocoa apps that are distributed privately and do not use the app store. They haven't been touched for at least a year. I need to make some changes. They don't work properly with Apple's sandbox. I've tried to turn off sandboxing in Xcode (9.4.1), but the absence of an entitlements file seems to be interpreted as sandboxed. I've noticed that command line applications don't have this problem (yet). How can I get the old behavior back? In the past I signed the apps to minimize

LaunchAgent - Is there something like RunAtScreenSaver?

家住魔仙堡 提交于 2020-01-15 09:32:06
问题 I am looking for a way to execute my app (it's a background task) at times, where the machine is "idle". A good incident would be when the screensaver launches. I already read the manual auf launchd and already use a LaunchAgent to lauch my app at certain intervals, but I found nothing that might help me launching my app when the screensaver is active. Is there any possibility to do that? Thanks in advance! Josh 回答1: Have another process that runs in the background and listens for distributed

SetHidden not working [duplicate]

大兔子大兔子 提交于 2020-01-15 08:18:05
问题 This question already has answers here : Cannot hide Controls in NSView (2 answers) Closed 6 years ago . I am developing an application in cocoa.I need to hide a progress bar placed in an NSView and show an NSTextfield in that place .I used the following cod [progressbar setHidden:TRUE] [textfield setHidden:FALSE]; But this code snippet is not working. Is that a bug.??I used to hide the same code to hide certain other text fields in the same page .But that controls became hidden.looking for a

What entitlements must I specify to use defaults write com.apple.screencapture in NSTask()

你离开我真会死。 提交于 2020-01-15 07:20:09
问题 I got the app working fine then went to submit to the app store and discovered this thing called the sandbox :-p I have been reading the documentation and developer forums, but I cant figure out specifically what entitlement I need to add to get this working: let task = NSTask() task.launchPath = "/bin/bash" task.arguments = ["-c", "defaults write com.apple.screencapture type gif;killall SystemUIServer"] task.launch() I've thought perhaps com.apple.screencapture and com.apple.security