osx-lion

Calling App Expose In Lion

冷暖自知 提交于 2019-12-06 05:05:32
问题 Is there any way to call App Expose in Lion programmatically, for example on an event tap, etc? 回答1: If you don't mind using a TOTALLY UNDOCUMENTED API, which might change at any point without notice: void CoreDockSendNotification(CFStringRef, void *); (...) CoreDockSendNotification(@"com.apple.expose.front.awake", NULL); Other known arguments are @"com.apple.expose.awake" and @"com.apple.dashboard.awake" , which activate Mission Control and Dashboard, respectively. @"com.apple.showdesktop

Deploy Lion app to 10.6 exception

六眼飞鱼酱① 提交于 2019-12-06 04:21:45
I have an OS X App That builds on Lion (with latest sdk) but deploy set to 10.6 (to be able run on Snow Leo). ARC enabled. I want's to run app on Show Leopard. Application works well on Lion. But when I start application in 10.6 I get this exception in console: NSRLEArray objectAtIndex:effectiveRange: Out of bounds And nothing more. No stack or whatever. Just this one line. What I may do to clarify situation ? Problem seems more strange, since in Lion all works good. 来源: https://stackoverflow.com/questions/11723476/deploy-lion-app-to-10-6-exception

XCode 4.2.1 Crashes on Lion 10.7.2 on Launch

◇◆丶佛笑我妖孽 提交于 2019-12-06 04:08:59
问题 This week I bought my first Mac in about 10 years (yeah!). It's a used Mac Pro (2x2GHz Dual-Core Xeon with 2GB RAM). It has a fresh install of Mac OS X Lion 10.7.2. I've only installed OmniOutlner Pro, Textmate, and Ruby RVM. I've also downloaded and installed Xcode 4.2.1 from the App Store. At first, Xcode worked fine (only launched to see if it worked). Then, the next day I launched Xcode to start using it and it crashed immediately upon launch. Since then, I've tried many things to try to

NSLineBreakByTruncatingTail scrolls text when set as a paragraph style in NSTextView

你。 提交于 2019-12-06 03:18:59
I have a NSTextView , which is supposed to be fixed size. When the text comes to the bottom line and to the right edge of the designated frame I need to set the NSLineBreakByTruncatingTail in order to present user with elliptic signs and disable further typing. When I do this through setting a paragraph style on textStorage of NSTextView the text scrolls up and I see only the last line with elliptic signs in the end. My question is how to prevent NSTextView from scrolling when changing its lineBreakMode ? Thanks, Nava EDIT: (added screenshots) Before: After: Now here's the code that does it: -

Enabling Xdebug on Mac OS X Lion

风格不统一 提交于 2019-12-06 03:17:59
问题 i've been trying to enable Xdebug for Mac OS X Lion, but can't make it work. This should be pretty straight forward but it just isn't working for me. These are the steps i took: 1 - Uncommented this line of the php.ini file: zend_extension="/usr/lib/php/extensions/no-debug-non-zts-20090626/xdebug.so" 2 - Restarted my Apache Server with sudo apachectl restart 3 - Checked that it is enabled via the phpinfo() function. It is in fact enabled both as Zend module and as a separate module. But it

Mail like search field with tokens (Mac OS X 10.7)

时光怂恿深爱的人放手 提交于 2019-12-06 01:31:38
问题 Is there a standard control for developers to get the search field behavior like in Mail (Mac OS X 10.7) to make advanced searches with tokens? In Mail the tokens are used to visualize a search for a mail which for example was sent by a person with the name "Steve Jobs". I try to accomplish the same but in another context. 回答1: What your looking for is called a token field. See the Token Field Programming Guide. (Also documented on the CocoaDev Wiki) 来源: https://stackoverflow.com/questions

How do i install additional packages for Xcode on OSX Lion to allow MacPorts to work

﹥>﹥吖頭↗ 提交于 2019-12-06 00:59:49
问题 When I try and install MacPorts it complains 'Xcode is not installed, or was installed with UNIX Development (10.5+) or Command Line Support (10.4) deselected.' I do have Xcode installed from the Appstore so I guess I just have to install these extra parts but how ? Ive read a couple of questions on Stack Overflow about this but I think the answers must be outdated as they do notmake sense for me, I do not have an Xcode dmg I can reinstall from, and I can't see anything useful in /Developer

-[NSResponder swipeWithEvent:] not called

拜拜、爱过 提交于 2019-12-05 22:36:22
问题 I am writing an application targeting OS X Lion and Snow Leopard. I have a view that I want to have respond to swipe events. My understanding is that three-finger swipes will call -[NSResponder swipeWithEvent:] if that method is implemented in my custom view. I have already looked at this question and corresponding answers, and tried the following modified stub implementation of Oscar Del Ben's code: @implementation TestView - (id)initWithFrame:(NSRect)frame { self = [super initWithFrame

SDL with g++ on OSX Lion

半腔热情 提交于 2019-12-05 18:59:57
Dose anyone know how to set up SDL (simple direct media layer) on OSX Lion so I can compile my code with g++ ? I have read the "readme" that comes with the package and I have placed the frameworks folder in the relevant directory, however, this does not seem to be enough. Can anyone help me ? (I do not want to use Xcode) If you're not using XCode, and are compiling SDL projects using gcc , you can run: gcc -o test SDLTest.c `sdl-config --cflags --libs` g++ -o test SDLText.c `sdl-config --cflags --libs` This works happily for me on my mac - sdl-config --version returns 1.2.14 , and I can run

Get a list of unmountable drives using Cocoa

半城伤御伤魂 提交于 2019-12-05 18:09:27
I would like to obtain a list of drives that are unmountable/ejectable using Cocoa/Objective-C under OS X. I was hoping that NSWorkspace getFileSystemInfoForPath::::: would help me: NSArray* listOfMedia = [[NSWorkspace sharedWorkspace] mountedLocalVolumePaths]; NSLog(@"%@", listOfMedia); for (NSString* volumePath in listOfMedia) { BOOL isRemovable = NO; BOOL isWritable = NO; BOOL isUnmountable = NO; NSString* description = [NSString string]; NSString* type = [NSString string]; BOOL result = [[NSWorkspace sharedWorkspace] getFileSystemInfoForPath:volumePath isRemovable:&isRemovable isWritable: