0

I'm trying to add a chart to an iOS app, but keep getting this error. I know what typically causes this (duplicate outlet connections), and I've gone through this question and tried a bunch of the other suggestions, but no luck. Tried deleting the app on the simulator, cleaning the project, and a couple other ideas.

I'm going through this tutorial on charting in iOS, and have followed the instructions exactly. I have a view with the class LineChartView from the module Charts. I have an outlet setup that looks like this:

@IBOutlet weak var progressChart: LineChartView!

But this gives me the error:

This class is not key value coding-compliant for the key progressChart

If I remove the outlet, the chart shows up with the expected label "No chart data available", so the framework is clearly working. I've tried deleting and recreating the view and outlet from scratch multiple times, but keep getting the same problem.

The view looks like this in my storyboard:

<view contentMode="scaleToFill" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="Riq-m7-PZl" customClass="LineChartView" customModule="Charts">
    <rect key="frame" x="16" y="175" width="343" height="265"/>
    <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
    <color key="backgroundColor" red="0.93725490570000003" green="0.93725490570000003" blue="0.95686274770000002" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</view>

And the connection looks like this:

<connections>
    <outlet property="progressChart" destination="Riq-m7-PZl" id="IEj-3T-nAO"/>
</connections>

Any idea what else might cause this?

123
  • 8,733
  • 14
  • 57
  • 99
  • Just checking, you did put `import Charts` at the top of the class, correct? – Xcoder Jan 04 '18 at 02:12
  • @Xcoder Yes, `import Charts` is in the class – 123 Jan 04 '18 at 02:14
  • Check the identity inspector in your storyboard for your line chart view. Does it show `LineChartView` in the `Class` section, and `Charts` in the `Module` section? – Xcoder Jan 04 '18 at 02:20
  • @Xcoder Yup, both values are set correctly – 123 Jan 04 '18 at 03:06
  • @123 check you have assign the class to that and also check you have tickmark on the module means it is in same module ? and also try to search for same name outlet in the file so may be you will get some idea. if not so please let me know – Ravi Panchal Jan 04 '18 at 09:27

0 Answers0