From: Sam R. <sro...@un...> - 2003-03-16 02:07:22
|
Thanks for your very timely help! Where can I find the ruby library files for 'osx/objc/cocoa' and foundation? Are they implemented in C? I want to be able to browse the src to get a better idea what is available, where NSProprietarStringEncoding is defined, etc. I installed the binary image, do I need the source to get these things? Sam Quoteing hi...@im..., on Sun, Mar 16, 2003 at 09:57:54AM +0900: > At Sat, 15 Mar 2003 18:14:25 -0500, > Hi, > > Sam Roberts wrote: > > Hi, just started working with ruby cocoa, and am having a lot of fun. > > > Why does OSX::NSData.to_s return a ruby String that looks like "<xxxxxx > > xxxxxx>" (where x are hex digits)? I didn't expect this: > > NSObject#to_s (and NSData#to_s) is same as `NSData.description.cString'. > > The following code snippet may be what you want except it is too verbose. > > vcdata = OSX::ABAddressBook.sharedAddressBook.me.vCardRepresentation > enc = NSProprietaryStringEncoding # specify an appropriate encoding. > str = OSX::NSString.alloc.initWithData_encoding( vcdata, enc ) > > or > > str = ' ' * vcdata.length > vcdata.getBytes(str) > str > > RubyCocoa is implemented like this currently. However, I recognize > that behavior of such implementation is not so good. > > -- > FUJIMOTO Hisakuni > > > ------------------------------------------------------- > This SF.net email is sponsored by:Crypto Challenge is now open! > Get cracking and register here for some mind boggling fun and > the chance of winning an Apple iPod: > http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0031en > _______________________________________________ > Rubycocoa-talk mailing list > Rub...@li... > https://lists.sourceforge.net/lists/listinfo/rubycocoa-talk |