From: Ed H. <ed...@fa...> - 2003-12-07 18:18:12
|
I'm very new to rubycocoa, and I'm not sure how to interpret this error. Here is a script which demonstrates the problem: -- #!/usr/bin/ruby require 'osx/cocoa' data=OSX::NSString.stringWithContentsOfFile('HTTPCookies.plist') mo=OSX::NSPropertyListMutableContainersAndLeaves fmt=OSX::NSPropertyListXMLFormat_v1_0 errst=OSX::NSString.alloc.init pl=OSX::NSPropertyListSerialization.propertyListFromData_mutabilityOptio n_format_errorDescription(data,mo,fmt,errst) puts pl.inspect -- It fails with this error: bash-2.05a$ ./plist.rb /Library/Frameworks/RubyCocoa.framework/Versions/A/Resources/ruby/osx/ objc/oc_wrapper.rb:17:in `ocm_send': NSPropertyListSerialization#propertyListFromData:mutabilityOption:format :errorDescription: - cannot convert the argument #2 as '^i' to NS argument. (OSX::OCDataConvException) from /Library/Frameworks/RubyCocoa.framework/Versions/A/Resources/ruby/osx/ objc/oc_wrapper.rb:17:in `method_missing' from ./plist.rb:10 I'm not sure what I'm doing wrong here. I assume argument #2 refers to mo, the mutability option, and I've determined that its value is 1. (The value of fmt is 100.) I tried wrapping those arguments up in conversions to NSNumber, like this: mo=OSX::NSNumber.numberWithInt(OSX::NSPropertyListMutableContainersAndLe aves) fmt=OSX::NSNumber.numberWithInt(OSX::NSPropertyListXMLFormat_v1_0) But I get the same error. |