Frank
Frank

Reputation: 1

lValue required as left Operand of Assignment

I'm trying to UnArchive into an NSMutableArray. This statement gives me an 'Lvalue required as left operand of assignment'

[[[VariableStore sharedInstance] riskValues] = [NSKeyedUnarchiver unarchiveObjectWithFile:[self archivePath]]];

The NSMutableArray is declared in the VariableStore singleton. Any ideas, anyone please?

Upvotes: 0

Views: 350

Answers (2)

avizzini
avizzini

Reputation: 789

You can't assign values like that, you would need a setter method...

[[VariableStore sharedInstance]setRiskValues:[NSKeyedUnarchiver unarchiveObjectWithFile:[self archivePath]]];

Upvotes: 1

Mats Stijlaart
Mats Stijlaart

Reputation: 5098

You should use a setter:

[VariableStore sharedInstance].riskValues = [NSKeyedUnarchiver unarchiveObjectWithFile:[self archivePath]];

Or:

[[VariableStore sharedInstance] setRiskValues:[NSKeyedUnarchiver unarchiveObjectWithFile:[self archivePath]]];

Upvotes: 0

Related Questions