开发者

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜