osx-yosemite

Why I never see the Hello text in Console in this program?

≯℡__Kan透↙ 提交于 2020-01-02 19:27:07
问题 This is the code I have, running on OS X Yosemite int main(int argc, char *argv[]){ while (1) { srand(time(NULL)); int r = rand(); printf("Allocating\n"); int *pi = malloc(5000000 * sizeof(int)); if(pi==NULL){ printf("Hello"); } memset(pi, r, 5000000 * sizeof(int)); } } So this program eventually stops running, last lines in Console I see being: Allocating Allocating Allocating Killed: 9 Korays-MacBook-Pro:hello2 koraytugay$ If malloc does not return NULL in this situation, when will it do?

How to allow permission for user's Home folder in cocoa application for mac

|▌冷眼眸甩不掉的悲伤 提交于 2020-01-02 17:56:13
问题 I am having a mac app in which I am deleting some data from user's Home directory. My app is rejected saying the below reason. The app only finds files in the ~/Downloads folder. It would be appropriate to have the user grant access to the Home folder. So I used NSOpenPanel for asking the access from the user but I have no idea about how to give access to user's hidden folders. EDIT I have successfully enabled sandboxing for my app but now on allow button, what should I do? Please guide me on

google.protobuf installed, but module not found

点点圈 提交于 2020-01-02 09:27:24
问题 I have installed protobuf but when I run my script that uses pb.py it complains: from google.protobuf import descriptor as _descriptor ImportError: No module named google.protobuf However when I run protoc --version I see libprotoc 2.6.1 The previous posts say to see if protobuf is within the path of python, I can't find the protobuf path though. Can anyone tell me what I'm doing wrong? I'm running Yosemite. 回答1: I had that exact problem yesterday. Basically you have protoc already, you just

OS X Yosemite Spotlight extensions

久未见 提交于 2020-01-01 02:38:05
问题 Is it possible to extend spotlight's search feature to support additional commands? For example, is it possible to define custom web search aliases, meaning I could type yt and it would provide results from youtube. Alternatively, is it possible to add additional system commands were I could type sl (or some variant) to put my computer to sleep. 回答1: No it is not possible, there are only 4 types of extensions for OS X Yosemite: Today - Get a quick update or perform a quick task in the Today

how to handle applicationShouldHandleReopen in a Non-Document based Storyboard Application

强颜欢笑 提交于 2019-12-31 10:44:34
问题 The best I have been able to figure out is: func applicationShouldHandleReopen(sender: NSApplication, hasVisibleWindows flag: Bool) -> Bool { if !flag{ let sb = NSStoryboard(name: "Main", bundle: nil) let controller = sb?.instantiateInitialController() as NSWindowController controller.window?.makeKeyAndOrderFront(self) self.window = controller.window } return true } But that requires that I set a ref to the window on my app delegate. Since that isn't required when the app initially starts I'm

Install JDK 1.5 in OSX 10.10 Yosemite

喜你入骨 提交于 2019-12-30 11:21:51
问题 I use OS X Yosemite (10.10.2) and I have to use JDK 1.5 for legacy application development. I found this post which refers to this script to install JDK 4,5,6 in Lion and Mavericks. In comments I found this two lines /usr/libexec/PlistBuddy -c "Set :JavaVM:JVMMaximumFrameworkVersion 14.*.*" ./Resources/Info.plist /usr/libexec/PlistBuddy -c "Set :JavaVM:JVMMaximumSystemVersion "$osx_version".*" ./Resources/Info.plist have to be changed by /usr/libexec/PlistBuddy -c "Delete :JavaVM

Install JDK 1.5 in OSX 10.10 Yosemite

瘦欲@ 提交于 2019-12-30 11:21:03
问题 I use OS X Yosemite (10.10.2) and I have to use JDK 1.5 for legacy application development. I found this post which refers to this script to install JDK 4,5,6 in Lion and Mavericks. In comments I found this two lines /usr/libexec/PlistBuddy -c "Set :JavaVM:JVMMaximumFrameworkVersion 14.*.*" ./Resources/Info.plist /usr/libexec/PlistBuddy -c "Set :JavaVM:JVMMaximumSystemVersion "$osx_version".*" ./Resources/Info.plist have to be changed by /usr/libexec/PlistBuddy -c "Delete :JavaVM

How to uninstall Qt Creator on Mac Yosemite

爷,独闯天下 提交于 2019-12-30 08:32:33
问题 I have tried this but when I do, the terminal ask me for password. I don't know what this password is? I don't have any password on my mac, i don't enter any password when I login and I can't get passed the first step below. sudo QtSDK/SDKMaintenanceTool.app/Contents/MacOS/SDKMaintenanceTool I am uninstalling Qt Creator 2.8.1 on Mac OS Yosemite 10.10 I just want to install the latest 5.3.2 version and get rid of the old one. I could probably choose a new folder but I don't want to do that and

NSStoryboardSegue sample code (Yosemite Storyboard)

自古美人都是妖i 提交于 2019-12-30 05:13:08
问题 OS X Yosemite introduced NSStoryboardSegue “A storyboard segue specifies a transition or containment relationship between two scenes in a storyboard…” Update: • If I attempt to use a NSStoryboardSegue subclass in a Storyboard with Yosemite., it crashes with SIGABRT. • If I ignore segues, and manually present a view controller using a specified, custom animator for presentation and dismissal, func presentViewController(_ viewController: NSViewController, animator animator:

How to get the source lists selection highlight to use the Dark Vibrancy appearance in OS X 10.10?

回眸只為那壹抹淺笑 提交于 2019-12-30 00:37:47
问题 In OS X 10.10 source lists seem to use the light vibrancy appearance. In the Finder (and in some other third party applications, Things.app for example) the selected item in the source list is indicated by a dark vibrancy appearance. For example, see the Desktop row in the image below. How can I replicate this behaviour? Do I need to use the delegate methods to specify the table row view, -outlineView:rowViewForItem: and attempt custom drawing myself or is there a more straight forward