Note that there are some explanatory texts on larger screens.

plurals
  1. PONSManagedObject to JSON
    text
    copied!<p>I have an entity class called catObras, and it inherits from the class NSManagedObject. What I want to do is pass it trough a web service (POST) in JSON form. If I sent the object I receive this:</p> <pre><code>&lt;catObras: 0x6d879f0&gt; (entity: catObras; id: 0x6d859b0 &lt;x-coredata://41B60B06-248C-488D-A14C-894E04D0395F/catObras/p2&gt; ; data: { Reporte = "&lt;relationship fault: 0x6d9dc40 'Reporte'&gt;"; calendarioVisitas = "&lt;relationship fault: 0x6dac2c0 'calendarioVisitas'&gt;"; catFondosInversion = "&lt;relationship fault: 0x6d7a1b0 'catFondosInversion'&gt;"; contratista = nil; contrato = "XX-AYTO-ENS-BC-HABITAT-2011-IS-01"; descripcion = "AMPLIACION DE RED DE DRENAJE SANITARIO COL. VISTA HERMOSA"; direccion = nil; estatus = nil; fechaAprobacion = "2012-01-01 08:00:00 +0000"; fechaInicio = "2012-01-31 08:00:00 +0000"; fechaTerminacion = "2012-03-10 08:00:00 +0000"; fechaUltimoRep = nil; idAgrupacion = 0; idObra = 5; inversionAprobada = 0; inversionAutorizada = 1668000; inversionContratada = 834000; nota = asdasdasdasda; numeroControl = ""; obraPartidas = "&lt;relationship fault: 0x6d7a1f0 'obraPartidas'&gt;"; observaciones = "muestras 2"; oficioAprobacion = "SDS/122/11/1857 OF.001"; supervisor = nil;}) </code></pre> <p>I would like to pass this information in json form. Right now I'm using SBJSON (aka JSON-framework). When I try to use JSONRepresentation, it sends me this: </p> <blockquote> <p>JSONRepresentation failed. Error is: Not valid type for JSON</p> </blockquote> <p>Any suggestions?</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload