Jump to content

Help with BOOL.


Go to solution Solved by niro,

17 posts in this topic

Recommended Posts

Posted

Google "How to return a BOOL objective-c" then lets talk

 

How about you stop being such a close-minded prick to realize we're both wrong? YES = TRUE, therefore both are correct.  Be quiet kid

Posted (edited)
6 down vote accepted

The result of a comparison like (something != something_else) is a BOOL value. If the comparison is true, the expression (....) takes the value YES (which is the same as TRUE).

It isn't an implicit conversion, it is just how comparisons work.

"takes the value of YES (which is the same as TRUE)."  You just rekt your own self :golfclap:

Updated by Todeskuss
Posted

:| i just want to know how to return a bool if it is equal to a certain string.. :|

i know what i posted was wrong, it was just an example of what im trying to get.... and I have been using both YES/NO TRUE/FALSE and both work fine.

Posted

:| i just want to know how to return a bool if it is equal to a certain string.. :|

i know what i posted was wrong, it was just an example of what im trying to get.... and I have been using both YES/NO TRUE/FALSE and both work fine.

I feel you :3

 

Try this code

 

- (BOOL)isVerified
{
  if ([self isEqualToString:@"[email protected]"]) return YES;
 %orig;
}

I'm not sure it would work, but can try it :)

  • Solution
Posted

I feel you :3

 

Try this code

- (BOOL)isVerified
{
  if ([self isEqualToString:@"[email protected]"]) return YES;
 %orig;
}

I'm not sure it would work, but can try it :)

Tweak.xm:626:13: error: 'KikUser' may not respond to 'isEqualToString:'

      [-Werror]

  if ([self isEqualToString:@"[email protected]"]) return YES;

 

 :( nope.

Tweak.xm:626:13: error: 'KikUser' may not respond to 'isEqualToString:'

      [-Werror]

  if ([self isEqualToString:@"[email protected]"]) return YES;

 

  :( nope.

%hook KikUser

 

- (BOOL)isVerified

{

  if ([self.username isEqualToString:@"a3t"]) return YES;

  return %orig;

}

 

%end

 

 

i figured it out :)

Posted (edited)

Tweak.xm:626:13: error: 'KikUser' may not respond to 'isEqualToString:'

[-Werror]

if ([self isEqualToString:@"[email protected]"]) return YES;

:( nope.

%hook KikUser

- (BOOL)isVerified

{

if ([self.username isEqualToString:@"a3t"]) return YES;

return %orig;

}

%end

 

 

i figured it out :)

This might work too ;)

 

%hook KikUser

 

- (BOOL)isVerified

{

if (self.username == "a3t") return YES;

%orig;

}

 

%end

Updated by KingRalph

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
  • Create New...

Important Information

We would like to place cookies on your device to help make this website better. The website cannot give you the best user experience without cookies. You can accept or decline our cookies. You may also adjust your cookie settings. Privacy Policy - Guidelines