Ho il seguente dizionario:ricevere elemento di raccolta di tipo int non è un oggetto Objective C in iOS
NSDictionary* jsonDict = @{
@"firstName": txtFirstName.text,
@"lastName": txtLastName.text,
@"email": txtEmailAddress.text,
@"password": txtPassword.text,
@"imageUrl": imageUrl,
@"facebookId": [fbId integerValue],
};
Nel l'ultimo elemento, ho bisogno di usare un intero, ma sto ricevendo l'errore:
collection element of type int is not an objective c object
Come posso utilizzare un valore int in questo elemento?
'@" facebookId ": [fbId integerValue]' dovrebbe essere '@" facebookId ": @ ([fbId longLongValue])'. In Swift, tuttavia, non vi è alcun requisito per i numeri: cioè jsonDict = [..., "facebookId": fbId.longLongValue()] ' –