Jump to content

Help with BOOL.


Go to solution Solved by niro,

17 posts in this topic

Recommended Posts

Posted

hey, so im trying to make a bool return as true only if the string equals XXX

so i have

 

- (BOOL)isVerified
{
  if ([argument isEqualToString:@"[email protected]"]) return YES;

 %orig;
}

 

 

now i know thats wrong. BUT it helps explain what im striving for, So like i said, i only want it to return true if its equal to that string or my username. what else is there that i could use besides

"isEqualToString"

 

sorry I am terrible at explaining.

Posted

hey, so im trying to make a bool return as true only if the string equals XXX

so i have

 

- (BOOL)isVerified

{

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

 %orig;

}

 

 

now i know thats wrong. BUT it helps explain what im striving for, So like i said, i only want it to return true if its equal to that string or my username. what else is there that i could use besides

"isEqualToString"

 

sorry I am terrible at explaining.

 

"argument" isn't defined, function isn't in brackets, you wouldn't need an %orig, but a return %orig; instead

Posted (edited)

The function is in brackets....

 

Nope,  the method is in brackets. method != function.  By function, I was referring to everything to be ran after the 'if' statement.  Learn your stuff m8.

 

- (BOOL)isVerified

{

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

 %orig;

}

 

As you can see, the "return YES;" isn't in brackets { }.  Also, it would be TRUE, not YES.

Updated by Todeskuss
Posted (edited)

Nope,  the method is in brackets. method != function.  By function, I was referring to everything to be ran after the 'if' statement.  Learn your stuff m8.

 

 

As you can see, the "return YES;" isn't in brackets { }.  Also, it would be TRUE, not YES.

1. a function != if statement

2. an If Statement does not have to have brackets as long its only one line in the if statement

3. Its YES not TRUE, because TRUE isn't defined like YES is

 

learn ur stuff m8

Updated by SexyDiDA
Posted

1. a function != if statement

2. an If Statement does not have to have brackets as long its only one line in the if statement

3. Its YES not TRUE, because TRUE isn't defined like YES is

 

learn ur stuff m8

 

if statement : the conditionals in the parenthesis

function : what is to be run if the conditions are met

 

a boolean is true or false, not yes or no.  Therefore a bool cannot be returned as a YES, but a TRUE. 

learn ur stuff m8

Posted

if statement : the conditionals in the parenthesis

function : what is to be run if the conditions are met

 

a boolean is true or false, not yes or no.  Therefore a bool cannot be returned as a YES, but a TRUE. 

 

learn ur stuff m8

if statement : the conditionals in the parenthesis

function : what is to be run if the conditions are met

 

a boolean is true or false, not yes or no.  Therefore a bool cannot be returned as a YES, but a TRUE. 

 

learn ur stuff m8

:facepalm: this is a BOOL not a bool, gets ur facts right

a BOOL is a typedef of a signed char, u return YES

 

geezus, leave this issue to actual coders plz 

Posted

:facepalm: this is a BOOL not a bool, gets ur facts right

a BOOL is a typedef of a signed char, u return YES

 

geezus, leave this issue to actual coders plz 

 

[sarcasm] Okay sure buddy, because my patcher I made a few days ago has BOOLs returned as TRUE and they don't work [/sarcasm]

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