I want to create a method like this:
- (void) checkAndUpdateStringProperty: (NSString **) property{
if (...)
*property = @\"whatever\";
}
>
There are very few places in the Apple APIs that a value is passed in this fashion, the main one being NSError. It is really best to just return the result. If you do have a reference parameter the general Apple rule is that it should be the last parameter that that the method name begin with "get" as in getCheckAndUpdateStringProperty.
But you can do it, it is just not what we are used to.
The error you are seeing is that self.productName is really shorthand for the method call: [self productName] so &self.productName is interpreted as &[self productName].
Further in this case if productName is a @property with a retain attribute the reference counting will be subverted.