ChartsOrg / Charts

Beautiful charts for iOS/tvOS/OSX! The Apple side of the crossplatform MPAndroidChart.
Apache License 2.0
27.59k stars 6k forks source link

Charts framework not usable in a Swift class added to an Objective C project #1545

Closed indieshack closed 8 years ago

indieshack commented 8 years ago

I've at Last managed to install the Charts Framework into my Objective C project with no compile issues, but it does NOT work correctly when the Charts API is used from a SWIFT class that's been added to the Objective C project. Any ideas for how to fix this?

* Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[_SwiftValue yMax]: unrecognized selector sent to instance 0x618000246000' * First throw call stack: ( 0 CoreFoundation 0x0000000100c5b34b exceptionPreprocess + 171 1 libobjc.A.dylib 0x0000000104aed21e objc_exception_throw + 48 2 CoreFoundation 0x0000000100ccaf34 -[NSObject(NSObject) doesNotRecognizeSelector:] + 132 3 CoreFoundation 0x0000000100be0c15 ___forwarding_ + 1013 4 CoreFoundation 0x0000000100be0798 _CF_forwarding_prep_0 + 120 5 Charts 0x000000010199e76f _TFC6Charts9ChartData10calcMinMaxfT7dataSetPS_13IChartDataSetT_ + 79 6 Charts 0x000000010199d2e3 _TFC6Charts9ChartData10calcMinMaxfTT + 451 7 Charts 0x000000010199cf7f _TFC6Charts9ChartData17notifyDataChangedfTT + 31 8 Charts 0x000000010199ceea _TFC6Charts9ChartData10initializefT8dataSetsGSaPS13IChartDataSetT_ + 42 9 Charts 0x000000010199cbe2 _TFC6Charts9ChartDatacfT8dataSetsGSqGSaPS13IChartDataSet____S0 + 370 10 Charts 0x00000001018565b8 _TFC6Charts35BarLineScatterCandleBubbleChartDatacfT8dataSetsGSqGSaPS13IChartDataSet____S0 + 56 11 Charts 0x000000010196cdd5 _TFC6Charts12BarChartDatacfT8dataSetsGSqGSaPS13IChartDataSet____S0 + 69 12 Charts 0x000000010196ce54 _TFC6Charts12BarChartDataCfT8dataSetsGSqGSaPS13IChartDataSet____S0 + 52 13 QCM_Test 0x0000000100388671 _TFC8QCM_Test9GraphView12setDataCountfT5countSi5rangeSdT + 3729 14 QCM_Test 0x0000000100387747 _TFC8QCM_Test9GraphView12sqlDidFinishfT10controllerCS_9SQLServer7resultsCSo7NSArrayT + 583 15 QCM_Test 0x000000010038bf06 _TTWC8QCM_Test9GraphViewS_17SQLServerDelegateS_FS1_12sqlDidFinishfT10controllerCS_9SQLServer7resultsCSo7NSArrayT + 86 16 QCM_Test 0x0000000100385a56 _TFFFC8QCM_Test9SQLServer7getDataFT2mcSS_SSU_FSbT_U_FPT + 454 17 QCM_Test 0x00000001003847b3 _TTRXFo_iP_XFooGSqGSaP____ + 51 18 QCM_Test 0x00000001003847d7 _TTRXFo_oGSqGSaP___XFo_iGSqGSaPiT + 23 19 QCM_Test 0x00000001003863c1 _TPATTRXFo_oGSqGSaP_XFo_iGSqGSaPiT + 81 20 QCM_Test 0x0000000100384810 _TTRXFo_iGSqGSaP__iTXFooGSqGSaP____ + 32 21 QCM_Test 0x0000000100384895 _TTRXFo_oGSqGSaP___XFdCbdGSqCSo7NSArray + 117 22 QCM_Test 0x00000001002347c7 **38-[SQLClient executionSuccess:results:]_block_invoke + 55 23 Foundation 0x00000001045542cd NSBLOCKOPERATION_IS_CALLING_OUT_TO_A_BLOCK + 7 24 Foundation 0x0000000104553faf -[NSBlockOperation main] + 101 25 Foundation 0x00000001045526ac -[NSOperationInternal _start:] + 672 26 Foundation 0x000000010454e5ef __NSOQSchedule_f + 201 27 libdispatch.dylib 0x00000001061a50cd _dispatch_client_callout + 8 28 libdispatch.dylib 0x00000001061858d6 _dispatch_main_queue_callback_4CF + 406 29 CoreFoundation 0x0000000100c1f4f9 CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE** + 9 30 CoreFoundation 0x0000000100be4f8d CFRunLoopRun + 2205 31 CoreFoundation 0x0000000100be4494 CFRunLoopRunSpecific + 420 32 GraphicsServices 0x00000001075b4a6f GSEventRunModal + 161 33 UIKit 0x0000000102cc9f34 UIApplicationMain + 159 34 QCM_Test 0x000000010018e7bf main + 111 35 libdyld.dylib 0x00000001061f168d start + 1 36 ??? 0x0000000000000001 0x0 + 1 ) libc++abi.dylib: terminating with uncaught exception of type NSException

pmairoldi commented 8 years ago

Hmm. No idea. Ill look into it. Do you happen to have an example Xcode project I could look at before I try it myself.

pmairoldi commented 8 years ago

I just tried this and it works. My guess is that you are passing the wrong types of data to the chart.