How to convert UIView object to NSData and vise-versa  for saving it in database using sqlite

I am using sqlite for my project which stores all the data including text fields , id , and one UIVIew object in a column having BLOB datatype .
Now while retriving the data i use
const char *raw = sqlite3_column_blob(selectstmt, 3);
int rawLen = sqlite3_column_bytes(selectstmt, 3);
NSData *data = [NSData dataWithBytes:raw length:rawLen];
  view =[NSKeyedUnarchiver unarchiveObjectWithData:data];
where data is NSData obj n view is UIView obj ,
also while inserting data  i use ,
NSData *data=[[NSData alloc]init];
    data=[NSKeyedArchiver archivedDataWithRootObject:view];
   // [data dataForView:notes.view];
    sqlite3_bind_blob(updateStmt, 2, [data bytes], [data length], SQLITE_TRANSIENT);
But this is not working properly ...  the Data object is giving some length,
while using the view the view object is null
is there any other solution to do the same ?

There's a ton of information here: [http://www.json.org/] and I can't believe you didn't find that site yourself.

Similar Messages

  • How to convert XML doc to string and vice versa?

    Assume I have a XML doc and I want to convert it into a string (and put it into a string variable).
    How can I do this?
    How can I do the opposite: Convert a string content into a XML doc?
    Peter

    Use:
    ParseEscapedXML() and ora:getContentAsString()
    See
    http://www.codeguru.com/cpp/sample_chapter/article.php/c10789__7/
    Marc

  • How to convert ascii value into character and vice versa

    Hello the java world people,
    I want to convert each characters from my array into their corespondent ascii value and vice versa, how can I do that ?

    The term "ASCII" is often used very loosely.
    Java char values are UNICODE and the ASCII codes are indentical to UNICODE characters in the range 0 .. 127. UNICODE values 128 and above don't have coresponding ASCII values, though 128-255 corespond to ISO-8859-1 which is one of the encodings often called "extended ASCII".
    As shown above you can covert between chars and coresponding int value simply with a cast, but you should be aware that the more exotic characters will not give you sensible values.

  • How to convert matchcode objects to searchhelps.

    Hi,
    I had created search helps before but,
    We have a project in which we have matchcode objects. The client wants us to create
    searchhelps for those matchcode objects with the same name
    I am not getting how to convert matchcode objects to searchhelps.
    Regards,
    sarath.

    pick the object name and hit them in se11 search help row... that is a search help...
    parameter: p type x-x matchcode object <object_name>

  • How to convert Java Objects into xml?

    Hello Java Gurus
    how to convert Java Objects into xml? i heard xstream can be use for that but i am looking something which is good in performance.
    really need your help guys.
    thanks in advance.

    There are apparently a variety of Java/XML bindings. Try Google.
    And don't be so demanding.

  • How to check the usage of ram and cpu Performance for the particular application like sqlserver ,ms word

    how to check the usage of ram and cpu  Performance for the particular application like sqlserver ,ms word
    ranki

    Hi,
    You can use Performance Monitor and add the required counters.
    Check the below Technet article on Performance Monitor.
    http://technet.microsoft.com/en-us/library/cc749249.aspx
    Below are the steps to monitor the process in Performance Monitor.
    - Go to the Performance Monitor. 
    - Right-click on the graph and select "Add Counters".
    - In the "Available counters" list, open the "Process" section by clicking on the down arrow next to it. Select "% Processor Time" (and any other counter you want).
    - In the "Instances of selected object" list, select the process you want to track. Then click on "Add >>" button. Click on OK.
    Regards,
    Jack
    www.jijitechnologies.com

  • In the final display list how can i change rows to columns and vice versa

    in the final display list how can i change rows to columns and vice versa
    It's Urgent
    Thanks
    Basu

    Hai,
    Check this following Threads,
    converting rows to columns in internal tables
    Re: logic- report to move columns to row in a list
    Regards,
    Padmam.

  • HT204053 I have multiple devices used by family members, how do you make sure the kids don't see Moms messages from Dad and visa versa?

    I have multiple devices used by family members, how do you make sure the kids don't see Moms messages from Dad and visa versa?

    Hi Roger:
    Thanks for the reply.  I think I figured out the problem.  Apple has confused (at least in my mind) the different IDs that people can have.  In the iCloud settings, they use the term Apple ID and not iCloud ID.  I guess there really is no such thing as an iCloud ID.  There are Apple IDs with various attributes.  This is not clearly explained or easy to see (how could I look up to see if my Apple ID is associated with iTunes for example?).
    I created, what I thought were iCloud IDs for each family member, but we all use my Apple ID for iTunes.
    One other question - why does the syncing of Notes using iCloud require an @me.com email account.  That makes no sense to me.
    Thanks for your help!
    AO

  • I downloaded the new iOS 6 for my iphone 4.  I have 2 iphones on my account and after the "upgrade" text messages go to both phones.  When I send a text to my wife I recieve the same text and vise versa.  How can I fix this?

    I downloaded the new iOS 6 for my iphone 4.  I have 2 iphones on my account and after the "upgrade" text messages go to both phones.  When I send a text to my wife I recieve the same text and vise versa.  How can I fix this?

    "Sounds like you guys are using the same apple id for imessage.   You will need to create a separate id for you wife.  OR go to settings - message - receive&send and make sure your phone number is the default for both you and yoru wife.

  • Convert char to ascii code and vice versa

    HI
    Is there any function module to convert char to ascii code and vice versa.
    Thanks in advance

    Hi,
    be careful if you have unicode running in your system. URL_ASCII_CODE_GET is platform-dependent so it will return the internal HERX representation of the character in your system - which is hopefully and in most cases ASCII.
    Under unicode, we use double-byte characters here. I tried this function and the result CHAR_CODE is '00' regardless what character I specify for TRANS_CHAR. But the coding is so simple I corrected resultig in this sample code:
    [P]
    convert p_form to ASCII (internal) representation
      DATA:
        l_ofs TYPE syfdpos,
        l_len TYPE sy-linsz,
        l_ascii TYPE i.
      FIELD-SYMBOLS:
        <x> TYPE x.
      l_len = STRLEN( p_ascii ).
      DO l_len TIMES.
        l_ofs = sy-index - 1.
        ASSIGN p_ascii+l_ofs(1) TO <x> CASTING.
        l_ascii = <x>.
        WRITE: l_ascii.
      ENDDO.
    [/P]
    Here, for each character of string p_ascii, the internal (ASCII) representation is determined and written to the output list.
    Regards,
    Clemens

  • I already have a new book that is ready to publish as an iBook. In addition I also have an app prepared for this book. Please tell me how to upload this book (title is: "How To Cope...with life") and the app for it into your iBook Authors app so I can hav

    I already have a new book that is ready to publish as an iBook. In addition I also have an app prepared for this book.
    Please tell me how to upload this book (title is: "How To Cope...with life") and the app for it into your iBook Authors app so I can have it offered for sale @$0.99, in your app store?
    FROM: Terry Weber, Email: [email protected]

    https://itunesconnect.apple.com/WebObjects/iTunesConnect.woa/wa/bookSignup

  • How do your turn off the "black and White" setting for the visually impaired?

    How do you turn off the "black and White" setting for the visually impaired?  Also known as the "tripple Click"

    Settings>General>Accessibilty>White on black--> Off

  • How to make a button to stop and run a for loop?

    How to make a button to stop and run a for loop?  and if it is stopped it shall start from where i t stopped.

    Your VI has some very fundamental flaws.
    The start/stop button is outside the FOR loop, thus it will NOT get read during execution of the FOR loop, but only before the FOR loop starts. Think dataflow!
    Thus the terminal of the start/stop button belongs inside the FOR loop.
    Your FOR loop iterates 20x, which probably takes about a nanosecond. You will NOT be fast enough to reliably press the start/stop button during a specific iteration of the FOR loop.
    Your code does not "stop and run" a FOR loop (sic). The loop always spins, but executes an empty case when "Stopped". I guess that's what you actually want?
    Once you solve (2), the x indicator will contain a random value whenever you "stop".
    As soon as the 20 iterations complete, the outer while loop spin an things start over, another nanosecond later.
    Place e.g. a 500ms wait inside the FOR loop to solve this.
    Don't place terminals of indicators on top of formula nodes.
    Your formula does not produce any output, so really has no purpose.
    Use a real "stop" button to terminate the while loop (mechanical action: latch when released). Right now you are using a plain switch, which does not reset to false before the next run. This means that you need to manually reset it before running the program again.
    It is oftern useful to operate the VI in execution highlighting mode. You will immediately see that your button does not get read during execution of the FOR loop. Try it!
    LabVIEW Champion . Do more with less code and in less time .

  • HT2731 I have 2 iPhone 4's in my name.  How do I stop from sharing my photos from one phone to the other.  When I take a photo it shows up on my husbands phone and vise versa. We have our iCloud turned off

    I have 2 iPhone 4's in my name.  How do I stop from sharing my photos from one phone to the other.  When I take a photo it shows up on my husbands phone and vise versa. We have our iCloud turned off in both phones.

    well i think one of you should change yalls name on the iphone its may not be the icloud but the names

  • Which Acrobat or Adobe product is best to subscribe to for converting Word files (all types) to pdf files and visa versa?

    Which Acrobat or Adobe product is best to subscribe to for converting Word files (all types) to pdf files and visa versa?
    Thank you!

    Probably PDF Pack: Reliably Create PDFs, Convert PDFs, & Merge PDFs Online | Adobe PDF Pack

Maybe you are looking for