Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Implicit conversion of 'BOOL' (aka 'bool') to 'id' is disallowed with ARC

I am trying to pass to react-native a BOOL from objective C. My code is:

-(void)editProfile:(BOOL) success
{
  [self sendEventWithName:@"editUserProfile" body:success];
}

I keep getting the error:

Implicit conversion of 'BOOL' (aka 'bool') to 'id' is disallowed with ARC

Any thoughts?

like image 715
billysk Avatar asked Oct 25 '25 13:10

billysk


1 Answers

The body parameter is an object, not a primitive. You need to convert success to an NSNumber. The easiest way is with @():

[self sendEventWithName:@"editUserProfile" body:@(success)];
like image 99
Rob Napier Avatar answered Oct 28 '25 04:10

Rob Napier