1

我试图在单击未读按钮时将已读邮件标记为未读。邮件被标记为未读,但再次登录时,邮件显示为已读。这是我正在使用的代码的一部分:-

-(IBAction)markAsUnreadButtonAction:(id)sender{
    actionFlag = MailActionUnread;
    if(imapMessage){
        [[imapMessage flags] remove:PantomimeSeen];
        [mailListTable deselectAll:nil];
        [self setEmptyFieldsOnMailWindow];
        [currentImapFolder setFlags:[imapMessage flags] messages:[NSArray arrayWithObject:imapMessage]];
        int selectedRow = [mailListTable selectedRow];
        NSLog(@"");
        if(selectedRow >= 0){
            NSMutableDictionary *tempDic = [[NSMutableDictionary alloc] initWithDictionary:[mailListArray objectAtIndex:selectedRow]];
            [tempDic setObject:@"0" forKey:@"seen"];
            [mailListArray replaceObjectAtIndex:selectedRow withObject:tempDic];
            [tempDic release];
            [mailListTable reloadData];
            [unreadMailsCountDict setObject:[NSString stringWithFormat:@"%d",[[imapStore selectedFolder] numberOfUnreadMessages]] forKey:[[imapStore selectedFolder] name]];
            [totalMailsCountDict setObject:[NSString stringWithFormat:@"%d",[[imapStore selectedFolder] numberOfUnreadMessages]] forKey:[[imapStore selectedFolder] name]];
            [mailBoxesListTable reloadData];
        }
    }

}

请告知应该怎么做才能在再次登录时将未读邮件显示为未读。

4

0 回答 0