Proper way to retrieve data from TextField into NSString

Ivan Smahin ivan_smahin at valentina-db.com
Fri Sep 22 10:12:13 CDT 2006


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?


> 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 ÎÁ valentina-db.com



More information about the Valentina mailing list