1

My app has local notifications . It works perfectly fine . I use the Table view controller so show the active notification . The problem i am facing is that in the table view cell , it doesn't show that if the notification is set to repeat or when it will repeat (i.e., every hour , every day etc) .

The code for the table cell that show the details about every notifications is below :

  • (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *CellIdentifier = @"TableCell"; TableCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier forIndexPath:indexPath];

    // Get list of local notifications

    localNotifications = [[UIApplication sharedApplication] scheduledLocalNotifications]; UILocalNotification *localNotification = [localNotifications objectAtIndex:indexPath.row];

    NSString *dateString = [NSDateFormatter localizedStringFromDate:localNotification.fireDate dateStyle:NSDateFormatterMediumStyle timeStyle:NSDateFormatterNoStyle]; NSString *timeString = [NSDateFormatter localizedStringFromDate:localNotification.fireDate dateStyle:NSDateFormatterNoStyle timeStyle:NSDateFormatterShortStyle];

    cell.TitleLabel.text = localNotification.alertBody; cell.DateLabel.text = dateString; cell.TimeLabel.text = timeString; cell.repeatStatus.text =localNotification.repeatInterval;

    cell.textLabel.numberOfLines = 0;

    return cell;

}

i tried a lot of things , but nothing is working out . Please help .

Thanks in advance.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.