[quote]sh1.ConversionRate=1.6;
...
@interface ForeignStockHolding : StockHolding
{
float conversionRate;
}
@property float conversionRate;
@end[/quote]
The name of a property used in an expression should match the name in the corresponding declaration.
Therefore, the expresion sh1.[color=#FF0000]ConversionRate[/color] should be sh1.conversionRate.
Case matters: ConversionRate is not the same as conversionRate.
That didn’t solve my problem - I still get the same error.
The reason I went with the Uppercase is because the program works with these properties defined as shown (lowercase), yet referenced in main using Uppercase. If this works with properties in Stockholding, why not with the property in ForeignStockHolding?
In the future though, I think you may want to follow the suggested rule of thumb when it comes to making sure your declaring method and referencing method are exactly the same. I think the reason Xcode isn’t logging an error is because it understands what your referring to. Similar to when we didn’t place the asterisk for a pointer in the right place i.e. NSArray* pointer = @[…]; here the * should be placed right before “pointer”, as in *pointer. However, Xcode knows what your referring to so it’ll do it for you. It’s best practice to make it explicit but then again it’s your choice…