Use of unresolved Identifier

Hi everyone,


I was wondering if anyone could help me with this issue - I'm new to app development, but I've found it really fun so far. Although I have come across a problem for the past few hours. I've had a good search on this forum, and a few others but I can't seem to find a fix. If anyone could help out with this, I'm sure its a rather rookie mistake - I would really appreciate it!


This is my code so far in RatingControl.swift

[IMG]http://i62.tinypic.com/2h3yhjp.png[/IMG]

I've been following the apple developer tutorial set, the link is here if that helps. I've followed all the steps up to 'Declare a constant for the button size', that is where I have found myself stuck. The code seems to be right from the examples provided, I've checked enough times! https://developer.apple.com/library/prerelease/ios/referencelibrary/GettingStarted/DevelopiOSAppsSwift/Lesson5.html#//apple_ref/doc/uid/TP40015214-CH19-SW1

I've found that because the 'spacing' and 'stars' are both declared inside of the "intrinsicContentSize", that means that it is only visable locally, so it needs to be declared outside of the method. I'm just a bit confused how to do this (I'm sure its simple I know!), as the example shown is how mine looks.

Thank you so much for any help, its much appreciated!

Kate

Accepted Reply

It seems the current version of the tutorial is mis-configured and you need to do things described in the following section:

Add Properties for Spacing and Number of Stars

Ignore some `Checkpoint: Run your app.` until those properties actually added.


And if you have some time, send a Bug Report as documentation error.

Replies

It seems the current version of the tutorial is mis-configured and you need to do things described in the following section:

Add Properties for Spacing and Number of Stars

Ignore some `Checkpoint: Run your app.` until those properties actually added.


And if you have some time, send a Bug Report as documentation error.

Just need to define 'buttonSize' & 'stars' again in this function.

buttonSize could use exact the same one as in the other function above, stars is 5

not sure why they didn't mention it in here...

actually, i just changed the 'stars' to the already declared variable 'starCount' as i figured that's what they were really after (how many stars) given they had put the word 'stars' in the suggested code. it appears to work fine.