+5 votes
15.1k views
asked in Objective C by (8.2k points)

hi 

   We develop html universal app  so we used cordova.  cordova having local storage for store some data in device

we don't need localStorage instead we plan to use coredataStorage(ios storage)..

so we plan to override the localStorage.  localStorage("key","value"); this call to the our overrided fuction.is there any 

way do this?

1 Answer

+1 vote
answered by (2.6k points)
edited by

hi

 i hope this little bit of code solve your problem

Storage.prototype._setItem = Storage.prototype.setItem;

Storage.prototype.setItem = function(key, value)

{

  //do somthing here

}

Storage.prototype._getItem = Storage.prototype.getItem;

 Storage.prototype.getItem = function(key){

    // do somthing here

}

Categories

...