osx-lion

OSX AES Encryption is not working

﹥>﹥吖頭↗ 提交于 2019-12-08 12:33:05
问题 In my application, i need to encrypt the file before sending it over the network and on the other end, it will get decrypt, This is my code, -(void)doEncryptTest:(NSString *)pFileName{ // read the NSData; NSStringEncoding encoding =NSUTF8StringEncoding; NSString *pFileContent = @"xaaaaaaxxaaaaaax"; NSString *pKey = @"01234567012345670123456701234567"; NSData *pData = [pFileContent dataUsingEncoding:encoding]; NSData *pEncryptedData = [pData AES256EncryptWithKey:pKey]; NSData *decrypted=

“Function was not implemented” when trying to use ONI recording

烂漫一生 提交于 2019-12-08 10:43:50
问题 I'm trying to use an oni recording in my application using OpenNI. Here is my xml file: <OpenNI> <Licenses> <!-- Add application-specific licenses here <License vendor="vendor" key="key"/> --> </Licenses> <Log writeToConsole="false" writeToFile="false"> <!-- 0 - Verbose, 1 - Info, 2 - Warning, 3 - Error (default) --> <LogLevel value="3"/> <Masks> <Mask name="ALL" on="true"/> </Masks> <Dumps> </Dumps> </Log> <ProductionNodes> <Recording file="Recording.oni" /> <!-- Set global mirror -->

GUI Programming C++ for Mac OS X Lion

徘徊边缘 提交于 2019-12-08 10:40:03
问题 I'm probably going to get abuse for this question but here goes. Oh but before you tear into me and tell to crawl back under a rock etc. I have looked high and low and nothing has helped me so far either the software libs are out of date and for some reason wont work on lion. Ok other than Qt is there any other lightweight opensource GUI library for C++ on mac? I have tried this wxWidgets doesn't work for some reason. Apple don't seem to offer that carbon crap anymore or can I use openGL to

How to programmatically determine the currently active App in OS X?

允我心安 提交于 2019-12-08 09:54:21
问题 I have a simple statusbar applicationn which work in background. I want to know which app currently is active. It is possible? 回答1: Take a look at the NSRunningApplication class and its active property (I've linked the documentation for you). You can look at an array of running applications and find the one that's "active". Oh, and to get that array of running applications, you can do that via [NSWorkspace currentWorkspace] runningApplications]. Hope this helps! 来源: https://stackoverflow.com

- (void)swipeWithEvent:(NSEvent *)event not working on Lion?

让人想犯罪 __ 提交于 2019-12-08 07:10:38
问题 I'm writing a simple cocoa program that should use the swipe gesture. I've implemented in my NSView subclass the method swipeWithEvent: but when i try the program the method is never called. rotateWithEvent: method works instead. I'm using a Xcode 4.1 on Mac OS 10.7 Lion. Is there a difference between rotateWithEvent: and swipeWithEvent: ?? Why the first is called when I'm under the view and do a rotate gesture and the second in the same condition is never called if i do the swipe gesture?

Using g++ on OSX Lion, ld: unknown option: -no_compact_unwind

这一生的挚爱 提交于 2019-12-08 05:44:20
问题 I followed the instructions at https://sites.google.com/site/dwhipp/tutorials/mac_compilers for OSX Lion and XCode 4.3 to use g++ on the command line, but when I run it I get this: jeff~/Dropbox/cpp$ g++ hello.cpp ld: unknown option: -no_compact_unwind collect2: error: ld returned 1 exit status 回答1: If you want to use the latest version of GCC (4.7) by command line on Mac OS X Lion, I have a better solution. Install MacPorts (you can download the source code and compile it or download the pkg

Cannot connect to remote mysql from Mac lion

ⅰ亾dé卋堺 提交于 2019-12-08 03:56:51
问题 I'm a mac novice and trying to get a developer setup to develop php sites locally. The sites he develops have a mysql backend and that is on a remote box. We got xampp installed and working, he can connect from the website to the local mysql box but he cannot connect to the remote box. He is using the exact same connection info I am using from my windows system. I do not have any issues. Also the mysql server is setup to accept all users (we are currently using root) regardless of hostname. I

Ruby on Rails server won't start: dyld: lazy symbol binding failed: Symbol not found: _mysql_get_client_info

↘锁芯ラ 提交于 2019-12-07 19:09:36
问题 Environment (Mac OS X 10.7.2 - Lion): $ ruby -v ruby 1.9.3p0 (2011-10-30 revision 33570) [x86_64-darwin10] $ rails -v Rails 3.1.3 $ mysql -v Server version: 5.1.44 I try running the following but I'm greeted with the same error every time even after applying fixes from all over the web: $ rails server dyld: lazy symbol binding failed: Symbol not found: _mysql_get_client_info Referenced from: /Users/pressplay/.rvm/gems/ruby-1.9.3-p0/gems/mysql2-0.3.11/lib/mysql2/mysql2.bundle Expected in: flat

Trouble using g++ after upgrading to lion/ new xcode

只愿长相守 提交于 2019-12-07 18:50:44
问题 Just upgraded to Lion from SL, and downloaded xCode from app store. I go to compile "Hello World" and find that g++ isn't being found. After some searching, I find it in /Developer/usr/bin. I add this to my path, and try to compile, and now its saying it can't find iostream. Clearly, I missed some key setup step but I don't seem to know what it is. I don't seem to remember any of this when I installed dev tools for previous mac OS upgrades. Anyone else run into this problem or offer some

NSLineBreakByTruncatingTail scrolls text when set as a paragraph style in NSTextView

佐手、 提交于 2019-12-07 17:31: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