Proper way to retrieve data from TextField into NSString
Matthew Jew
mjew at icnc.com
Fri Sep 22 00:33:30 CDT 2006
On Sep 22, 2006, at 12:12 AM, Ivan Smahin wrote:
> Hello Matthew,
>
> Friday, September 22, 2006, 5:20:31 AM, you wrote:
>
>> Hello,
>
>> I am using C++ VSDK 2.4.2 on Mac (both PowerPC and Intel, which is
>> the core of my problem).
>
>> I have a TextField, defined this way:
>
>> valueText = CreateTextField ( Table, "valueText" );
>
>> In this field, I store an HTML page.
>> (To store the data, I just use Valentina Studio. I open the HTML page
>> in a text editor, select all, copy,
>> then paste the text into the "valueText" field in Valentina
>> Studio.)
>
>> My problem is how to retrieve it into an NSString.
>
>
> VText field is descendant of VString field. Why not use get_String()
> method?
>
There was a reason, but I do not remember it now.
I will do so.
>
>> I was doing it this way:
>
>> id returnValue = nil;
>> NSMutableData *aMutableData;
>> unsigned long dataLength;
>
>> I_FldBlob_Ptr pBlobField = dynamic_cast< I_FldBlob* >
>> (aHTMLTemplateTable->valueText.get());
>> dataLength = pBlobField->get_DataSize();
>> aMutableData = [[NSMutableData alloc] initWithLength:dataLength];
> pBlobField->>ReadData( (char *) [aMutableData mutableBytes],
>> dataLength );
>
> Reading VText as VBlob you have just binary data - so there are no
> byte-swapping.
>
> --
> Best regards,
> Ivan mailto:ivan_smahin at valentina-db.com
Thanks for the suggestion. It seems to work now, although I need to
do more testing.
- Matthew
More information about the Valentina
mailing list