how to use a bool variable in objective c

I am currently trying to use a boolean to check for when an event happens.. However I'm not sure how to use a boolean value in objective c

Heres what I'm doing.

//.h

BOOL *removeActivityIndicator;
//..
@property (nonatomic, assign) BOOL *removeActivityIndicator;

//.m

if ([filteredArray count] == 0)
        {
            self.removeActivityIndicator = YES;
        }
        else if([filteredArray count] !=0)
        {
            tempArray = filteredArray;
        }
}

So I'm checking if the filtered array has no values if thats the case then I want to stop my UIActivityIndicator thats Is currently running in my uitableview cell.

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
//...

//Stop ActivityIndicator if arrays have no values for the user
    if(indexPath.section == 0)
    {        
        if ((indexPath.row == 1) && (self.removeActivityIndicator == 0)) //problem
        {
            //Stop activity indicators
            //[activityView stopAnimating];
            cell.accessoryView = nil;//replaces activity indicator
        }
    }

//...

My problem happens in the if parameters..

(self.removeActivityIndicator == 0)

I have no idea how to check if the BOOL is true or not.

any help would be greatly appreciated.

Answers


in objective c true and false are YES and NO. Or, you can use this code:

if (!self.removeActivityIndicator) {}; 

it means

if (self.removeActivityIndicator == NO) {}; 

offcorse, removeActivityIndicator must be BOOL type


Need Your Help

Storing the value in last index object of nsarray

ios objective-c ios7

I am creating a bunch of buttons in a UIView dynamically. I added all the button frames and tag in a NSMutable array. I have a word like "escape" from which i am extracting each character and store...

Insert values from A table to A table

php mysql sql

I have one table in mysql that stores menu items. Structure is as below