Obtention d'un problème d'identificateur non déclaré dans mon code. Ont commenté les messages du compilateur.Identificateur non déclaré dans le code Objective-C
main.m
#import <Foundation/Foundation.h>
int main (int argc, const char * argv[])
{
@autoreleasepool {
NSMutableArray *stocks = [[NSMutableArray alloc]init];
NSMutableDictionary *stock;
stock = [NSMutableDictionary dictionary];
[stock setObject:@"AAPL"
forKey:@"symbol"];
[stock setObject:[NSNumber numberWithInt:200]
forKey:@"shares"];
[stocks addObject:stock];
stock = [NSMutableDictionary dictionary];
[stock = setObject:@"GOOG" // use of undeclared identifier 'setObject'
forKey:@"symbol"];
[stock = setObject:[NSNumber numberWithInt:160] // use of undeclared identifier 'setObject'
forKey:@"shares"];
[stocks addObject:stock];
[stocks writeToFile:@"/tmp/stocks/plist"
atomically:YES];
}
return 0;
}
Cela l'a fait; Je vous remercie. Doit avoir été «égale à l'aveugle signe» – pdenlinger