From: Hans-Georg <pan...@ma...> - 2008-04-14 19:53:29
|
Am 14.04.2008 um 20:41 schrieb Knud Hinnerk Möller: > how does one call methods like -[NSFileManager > fileExistsAtPath:isDirectory:] from Ruby, where the second parameter > is a pointer (in this case to a BOOL)? The Obj-C use is like this: > > BOOL isDir; > NSFileManager *fileManager = [NSFileManager defaultManager]; > if ([fileManager fileExistsAtPath:@"/bla/blub" isDirectory:&isDir] && > isDir) { > doSomething(); > // ... You should read: http://rubycocoa.sourceforge.net/WorkingWithPointers > Any suggestions? is_directory = OSX::NSFileManager.defaultManager.fileExistsAtPath_isDirectory?("/usr/ local/bin/") Hans-Georg |