Jump to content

Help with BOOL.


niro

17 posts in this topic

Recommended Posts

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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 

Link to comment
Share on other sites

: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]

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
  • 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