Anyone have a clue why I am getting this?
-(void)postPrimaryEMWithEM:(EM *)em
exclusive:(BOOL) isExclusive
success:(void (^)())onSuccess
failure:(void (^)())onFailure {
if(self.accessToken) {
GenericObject *genObject = [[GenericObject alloc] init];
[[RKObjectManager sharedManager] postObject:genObject
path:@"users/update.json"
parameters:@{
...
@"em_id" : ObjectOrNull(em.emID),
@"exclusive": isExclusive <-- error message
Remove the pointer ('*') form your BOOL:
exclusive:(BOOL*) isExclusive
and change:
@"exclusive": isExclusive
to:
@"exclusive": [NSNumber numberWithBool:isExclusive]
or:
// Literal version of above NSNumber
@"exclusive": @(isExclusive)
As a note, NSDictionary cannot store primitive types, including booleans. So you have to encapsulate the value in an object, in this case NSNumber.
You cannot put a fundamental data type in a dictionary. It must be an object. But you can use [NSNumber numberWithBool:isExclusive]
or use the @(isExclusive)
syntax:
[[RKObjectManager sharedManager] postObject:genObject
path:@"users/update.json"
parameters:@{
...
@"em_id" : ObjectOrNull(em.emID),
@"exclusive": @(isExclusive), ...
I also don't suspect you meant to use BOOL *
as your parameter. You presumably intended:
- (void)postPrimaryEMWithEM:(EM *)em
exclusive:(BOOL) isExclusive
success:(void (^)())onSuccess
failure:(void (^)())onFailure {
...
}
Again, a BOOL
is not an object, so the *
syntax was presumably not intended.
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