[Mono-osx] Help marshaling NSFormatter method

Alex Soto dxdream at gmail.com
Fri Aug 26 23:14:34 EDT 2011


Geoff +=  http://bugzilla.xamarin.com/show_bug.cgi?id=487

added bug report on behalf of Joseph

Alex


El 26/08/2011, a las 08:10 p.m., Geoff Norton <grompf at gmail.com> escribió:

> ByRef strings are currently not supported (NSString should work tho).  Please file a bug and assign it to me.
>
> -g
>
> On 2011-08-26, at 9:06 PM, Mattiello Joseph wrote:
>
>> NSFormatter uses a lot of output parameters of types like NSString **. I've found that when NSError** 's are used mono uses "out NSError". I've tried doing the same with both "out string" and "out NSString" but I continue to get bus errors with the following.
>>
>>       [Export ("isPartialStringValid:newEditingString:errorDescription:")]
>>       public bool IsPartialStringValid(string partialString, out string newString, out string error){
>>           error = "";
>>           newString = "";
>>
>>           if(partialString.Length <= this.length)
>>               return true;
>>
>>           newString = partialString.Substring(0, this.length);
>>
>>           return false;
>>       }
>>
>>
>> I've also tried with out NSString newString where newString = new NSString("foo");
>> I only get a bus error when encountering the false case immediately after return. I'm assuming that Cocoa isn't able to understand the memory passed to it. I haven't been able to backtrack in gdb, maybe I'm doing it wrong.
>>
>> Any help would be greatly appreciated. This is driving me nuts. And the NSFormatter class is actually incomplete on a method that also uses NSString** so I'll pass any input forward to fix that.
>>
>> Many thanks,
>> - Joe
>> _______________________________________________
>> Mono-osx mailing list
>> Mono-osx at lists.ximian.com
>> http://lists.ximian.com/mailman/listinfo/mono-osx
>
> _______________________________________________
> Mono-osx mailing list
> Mono-osx at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-osx


More information about the Mono-osx mailing list