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.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With