osx-yosemite

Include search path on Mac OS X Yosemite 10.10.1

不想你离开。 提交于 2019-12-03 07:36:18
问题 I just to change the include search path order (I believe). I'd like to change the include search path. Especially, I need /usr/local/include first. But it doesn't change because of duplicate. How can I change it? I suppose there's default setting, because paths I don't specify appears. Like /usr/include/c++/4.2.1 , /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/6.0/include "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault

Swift - Write Image from URL to Local File

那年仲夏 提交于 2019-12-03 07:34:48
问题 I've been learning swift rather quickly, and I'm trying to develop an OS X application that downloads images. I've been able to parse the JSON I'm looking for into an array of URLs as follows: func didReceiveAPIResults(results: NSArray) { println(results) for link in results { let stringLink = link as String //Check to make sure that the string is actually pointing to a file if stringLink.lowercaseString.rangeOfString(".jpg") != nil {2 //Convert string to url var imgURL: NSURL = NSURL(string:

What is the quickest way to toggle hide/show hidden files on a Mac OS X Yosemite?

限于喜欢 提交于 2019-12-03 07:30:50
问题 I'm on Yosemite, and I want to toggle hide/show all the hidden files on a Mac. Every-time, I want to do that I have to go to Terminal.app and run these command : To show defaults write com.apple.finder AppleShowAllFiles TRUE To hide defaults write com.apple.finder AppleShowAllFiles FALSE I'm wondering if there is a better tweak out there that accomplish this in just a click of a button. 回答1: I prefer using this shortcut: ⌘ CMD + ⇧ SHIFT + . 回答2: Update, considering all comments: try set state

How to develop status bar app in OS X Yosemite?

ぃ、小莉子 提交于 2019-12-03 07:05:52
I've been trying to develop a status bar app for Yosemite, which is my first OS X app, but when I searched for the document, the NSStatusItem documentation says that almost all of the properties and methods there (e.g. .title , .highlightMode , and .image ) are deprecated in OS X 10.10. So I wonder how I can create a status bar app for Yosemite. I found those documentations from Dash, but it's weird that Apple's documentation doesn't make it deprecated yet. But I know they are usually slow to update the documentation, though I wonder then how and where Dash got those seemingly updated

OS X Yosemite Spotlight extensions

天涯浪子 提交于 2019-12-03 06:19:27
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. 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 view of Notification Center Share - Post to a sharing website or share content with others Action -

“Couldn’t communicate with a helper application” on 10.10

我怕爱的太早我们不能终老 提交于 2019-12-03 06:05:55
I'm suddenly getting this error on Yosemite: ***storageTaskManagerExistsWithIdentifier:withIdentifier failed: Error Domain=NSCocoaErrorDomain Code=4099 "Couldn’t communicate with a helper application." (The connection to service named com.apple.nsurlstorage-cache was invalidated.) UserInfo=0x6000000621c0 {NSDebugDescription=The connection to service named com.apple.nsurlstorage-cache was invalidated.}; The app was working perfectly on Mavericks. Any ideas what might be going on? (I don't even have a clue where too look at... Sure, I have a WebView in there, but I haven't yet manage to figure

NSOpenPanel in Swift . How to open?

不打扰是莪最后的温柔 提交于 2019-12-03 05:52:19
I have this Objective-C Code : - (IBAction)selectFileButtonAction:(id)sender { //create open panel... NSOpenPanel* openPanel = [NSOpenPanel openPanel]; // NSLog(@"Open Panel"); //set restrictions / allowances... [openPanel setAllowsMultipleSelection: NO]; [openPanel setCanChooseDirectories:NO]; [openPanel setCanCreateDirectories:NO]; [openPanel setCanChooseFiles:YES]; //only allow images... [openPanel setAllowedFileTypes:[NSImage imageFileTypes]]; //open panel as sheet on main window... [openPanel beginWithCompletionHandler:^(NSInteger result) { if (result == NSFileHandlingPanelOKButton) { /

CGEventTapCreateForPSN in Mavericks+ (GetCurrentProcess deprecated)

守給你的承諾、 提交于 2019-12-03 05:18:07
I am using CGEventTapCreateForPSN to trap and filter keys for my application. I'm not interested in intercepting events for other applications. I'm pretty sure an event tap is too heavy handed for my purpose, but I've been unable to find a better way, and using the event tap works. Specifically, this code does what I want. GetCurrentProcess(&psn); CFMachPortRef eventTap = CGEventTapCreateForPSN( &psn, kCGHeadInsertEventTap, kCGEventTapOptionDefault, CGEventMaskBit(kCGEventKeyDown) | CGEventMaskBit(kCGEventKeyUp), eventCallback, userInfo); And my callback is handled nicely, with the events

Attempt to install Qt on OS X gives 'You need to install Xcode 5.0.0', but this version is so old it's not available

夙愿已清 提交于 2019-12-03 04:14:45
I am a Windows/Linux developer who occasionally builds for OS X - particularly in Qt. I have a simple Qt project that I have been developing on Windows. I now wish to build it on OS X. I am running Yosemite. I have installed Xcode 7 and am attempting to install Qt 5.5. When I run the Qt installer, immediately after the prompt to log in to Qt (which is successful), I receive the following error: You need to install Xcode version 5.0.0. I have attempted to locate Xcode 5.0.0 on the Apple Developer site, but this is 2 major versions behind the most recent version, and I cannot even find an

How to check if mongo db is running on Mac?

风格不统一 提交于 2019-12-03 04:11:52
问题 I had installed MongoDB few days back on my Mac and am not sure how I installed, but now how do I check if MongoDB is up and running in my system? 回答1: Quick Solution Run the following in your Terminal: ps -ef | grep mongod | grep -v grep | wc -l | tr -d ' ' This will get you the number of MongoDB processes running, thus if it is other than 0 , then you have MongoDB running on your system. Step-by-Step The ps -ef | grep mongod part return all the running processes, that have any relation to