开发者

lValue required as left Operand of Assignment

开发者 https://www.devze.com 2023-02-11 03:49 出处:网络
I\'m trying to UnArchive into an NSMutableArray. This statement gives me an \'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 de开发者_运维百科clared in the VariableStore singleton. Any ideas, anyone please?


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

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


You should use a setter:

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

Or:

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

精彩评论

暂无评论...
验证码 换一张
取 消