osx-lion

Where to put SQLite database to keep it from being over-ridden during update on OS X?

纵然是瞬间 提交于 2020-01-01 07:07:54
问题 I'm developing my first OS X application which will be distributed through Mac App Store. The app makes use of an sqlite database which I am currently keeping on the same location as the rest of app file dependencies. I'm using Qt Framework to develop the application. Keeping within the boundaries of App Store rules; Where can I locate the database file for it not to be overridden during app updates? How should I structure the .app folder and all the dependencies? Thank you. 回答1: Your

How do I animate fadeIn fadeOut effect in NSTextField when changing its text?

前提是你 提交于 2020-01-01 06:08:06
问题 I am trying to write a category for NSTextField which will add a new method setAnimatedStringValue . This method is supposed to nicely fade-out the current text, then set the new text and then fade that in. Below is my implementation:- - (void) setAnimatedStringValue:(NSString *)aString { if ([[self stringValue] isEqualToString:aString]) { return; } NSMutableDictionary *dict = Nil; NSViewAnimation *fadeOutAnim; dict = [NSDictionary dictionaryWithObjectsAndKeys:self, NSViewAnimationTargetKey,

How do I animate fadeIn fadeOut effect in NSTextField when changing its text?

≯℡__Kan透↙ 提交于 2020-01-01 06:06:32
问题 I am trying to write a category for NSTextField which will add a new method setAnimatedStringValue . This method is supposed to nicely fade-out the current text, then set the new text and then fade that in. Below is my implementation:- - (void) setAnimatedStringValue:(NSString *)aString { if ([[self stringValue] isEqualToString:aString]) { return; } NSMutableDictionary *dict = Nil; NSViewAnimation *fadeOutAnim; dict = [NSDictionary dictionaryWithObjectsAndKeys:self, NSViewAnimationTargetKey,

How do I animate fadeIn fadeOut effect in NSTextField when changing its text?

[亡魂溺海] 提交于 2020-01-01 06:06:02
问题 I am trying to write a category for NSTextField which will add a new method setAnimatedStringValue . This method is supposed to nicely fade-out the current text, then set the new text and then fade that in. Below is my implementation:- - (void) setAnimatedStringValue:(NSString *)aString { if ([[self stringValue] isEqualToString:aString]) { return; } NSMutableDictionary *dict = Nil; NSViewAnimation *fadeOutAnim; dict = [NSDictionary dictionaryWithObjectsAndKeys:self, NSViewAnimationTargetKey,

Installing numpy Lion with Python 2.7?

南笙酒味 提交于 2020-01-01 04:57:46
问题 I am working on a OS X 10.7 with Python 2.7 from python.org and XCode 4.2. Following these instructions, I tried changing the CC , CXX , and FFLAGS variables and install with sudo pip install numpy . However, the installation still looks for gcc-4.2 . I tried installing gcc-4.2 through MacPorts but get that Error: gcc42 does not build on Snow Leopard or later. When I install numpy from the precompiled binary on sourceforge, I get the following error: import numpy Traceback (most recent call

Getting sudo to ask for password via the GUI

家住魔仙堡 提交于 2020-01-01 04:18:28
问题 I have a lua script, running on the Mac, that needs to call sudo. I'd hoped that Mac OS would automatically bring up a password request dialog, but instead it the command fails by returning 256. Is there anyway that I can achieve my goal? Tim 回答1: Quick and easy way: run it like this /usr/bin/osascript -e 'do shell script "/path/to/myscript args 2>&1 etc" with administrator privileges' Proper and configurable way: use AuthorizationExecuteWithPrivileges API from Authorization Services (in

Using the python multiprocessing module for IO with pygame on Mac OS 10.7

放肆的年华 提交于 2020-01-01 04:14:12
问题 I use pygame for running experiments in cognitive science, and often I have heavy I/O demands so I like to fork off these tasks to separate processes (when using a multi-core machine) to improve performance of my code. However, I encountered a scenario where some code works on my colleague's linux machine (Ubuntu LTS), but not on my mac. Below is code representing a minimal reproducible example. My mac is a 2011 Macbook Air running 10.7.2 and using the default python 2.7.1. I tried both

Using the python multiprocessing module for IO with pygame on Mac OS 10.7

我怕爱的太早我们不能终老 提交于 2020-01-01 04:14:08
问题 I use pygame for running experiments in cognitive science, and often I have heavy I/O demands so I like to fork off these tasks to separate processes (when using a multi-core machine) to improve performance of my code. However, I encountered a scenario where some code works on my colleague's linux machine (Ubuntu LTS), but not on my mac. Below is code representing a minimal reproducible example. My mac is a 2011 Macbook Air running 10.7.2 and using the default python 2.7.1. I tried both

Mac OS X Lion: Detect if another application is running in full screen mode?

为君一笑 提交于 2020-01-01 04:04:10
问题 In a Cocoa app, is there a way to tell if another application currently is in full screen mode? My application is configured to show up on all Spaces and listens for mouseEntered events to order itself to the front. Problem is that when another app is in full screen mode and the user happens to move the mouse across the black area where my app's window is located, it is brought to the front (happens with multiple monitors). I've only seen the above behavior with [self setCollectionBehavior:

Xampp Won't Startup MySQL server on Mac OSX?

北战南征 提交于 2019-12-31 22:20:15
问题 I'm on a Mac OSX Mountain Lion. Xampp won't let me start MySQL server. I have set the permissions to Read/Write for everyone and every file in the XAMPP folder. The error message shows "The operation couldn't be completed. (XAMPPErrorDomain error 1.)" Any ideas on how to stop other MySQL processes. I have tried following this Lynda.com Tutorial on fixing port conflicts. I tried typing in this command "sudo lsof -i -P | grep 3306" in Terminal. However it didn't work, I wanted to test to see if