ios - getting error in EChart library [__NSCFString value] -
i using echart library, trying make bar chart in ipad. did make in demo project getting error :
-[__nscfstring value]: unrecognized selector sent instance 0x8bba220 2014-08-18 08:28:44.684 stat_v2_ipad[19187:70b] *** terminating app due uncaught exception 'nsinvalidargumentexception', reason: '-[__nscfstring value]: unrecognized selector sent instance 0x8bba220'
and here error code after debugging :
/** highest value among whole chart*/ - (ecolumndatamodel *) highestvalueecolumnchart:(ecolumnchart *) ecolumnchart{ ecolumndatamodel *maxdatamodel = nil; float maxvalue = -flt_min; nslog(@"after flt_min : %.f",flt_min); (ecolumndatamodel *datamodel in mergedarr) { nslog(@"data.value = %f",datamodel.value); if (datamodel.value > maxvalue) { nslog(@"inside ifd"); maxvalue = datamodel.value; maxdatamodel = datamodel; } } nslog(@"finished max %.f",maxdatamodel.value); return maxdatamodel; }
problem datamodel holds nsstring
instead of ecolumndatamodel
. below answer prevent crash need find how string takes place?
-(ecolumndatamodel *) highestvalueecolumnchart:(ecolumnchart *) ecolumnchart{ ecolumndatamodel *maxdatamodel = nil; float maxvalue = -flt_min; nslog(@"after flt_min : %.f",flt_min); (ecolumndatamodel *datamodel in mergedarr) { if([datamodel iskindofclass:[ecolumndatamodel class]]){ nslog(@"data.value = %f",datamodel.value); if (datamodel.value > maxvalue) { nslog(@"inside ifd"); maxvalue = datamodel.value; maxdatamodel = datamodel; } } } nslog(@"finished max %.f",maxdatamodel.value); return maxdatamodel; }
Comments
Post a Comment