Giter Site home page Giter Site logo

NSArray about ctpersistance HOT 5 CLOSED

casatwy avatar casatwy commented on July 29, 2024
NSArray

from ctpersistance.

Comments (5)

casatwy avatar casatwy commented on July 29, 2024

the testrecord is extended from CTPersistanceRecord, but actually, you don't have to do this.

Any object who confirms to CTPersistanceRecordProtocol can be a record, and can be accepted by CTPersistance, even a customized UIView.

so, in your case, you can implement an object who confirms to CTPersistanceRecordProtocol, in - (void)objectRepresentationWithDictionary:(NSDictionary *)dictionary; and - (NSDictionary *)dictionaryRepresentationWithTable:(CTPersistanceTable <CTPersistanceTableProtocol> *)table; you can handle NSArray.

from ctpersistance.

mythodeia avatar mythodeia commented on July 29, 2024

thanks a lot for your answer.
Can you add this case in your existing demo project for everyone to have?
great project
👍

from ctpersistance.

casatwy avatar casatwy commented on July 29, 2024

I think CTPersistanceRecord is the very case of this...

from ctpersistance.

mythodeia avatar mythodeia commented on July 29, 2024

as i see it i should add the array in the - (NSDictionary *)columnInfo method too.
so should i save the NSArray as a BLOB in the table?

from ctpersistance.

casatwy avatar casatwy commented on July 29, 2024

you can save the array data as a json string, and when you get data from database, you parse this json string into NSArray, while in - (void)objectRepresentationWithDictionary:(NSDictionary *)dictionary.

though sqlite support blob and CTPersistance is based on sqlite,I do not want to support blob type in first place, because I think all blob data like image should be saved as a file, and we save the path of image file in database.

from ctpersistance.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.