I have
-(void)saveAsset:(NSUInteger) assetID
{
AFHTTPRequestOperationManager *manager = [AFHTTPRequestOperationManager manager];
NSDictionary *parameters = @{@"asset_id": assetID};
but get the following error:
Collection element of type 'NSUInteger' (aka 'unsigned long') is not an Objective-C object
How can I assign this? I have tried:
NSDictionary *parameters = @{@"asset_id": [assetID integerValue]};
and
NSDictionary *parameters = @{@"asset_id": (id)assetID};
but neither of them are working.
@(assetID)
or (in old syntax):
[NSNumber numberWithInteger:assetID]
You tried to assign simple value (like int, char, etc.), while expected type is obj-c object (like NSNumber).
Btw. NSInteger is target depending type, so it will be 32-bit or 64-bit integer depending on target cpu.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With