1

我正在尝试使用 MailCode 编写邮件客户端。当我运行这段代码

CTCoreAccount *account = [[CTCoreAccount alloc] init];
CTCoreFolder *folder;
BOOL success=[account connectToServer:@"imap.qq.com" port:143 connectionType:CONNECTION_TYPE_PLAIN authType:IMAP_AUTH_TYPE_PLAIN login:@"1029418889@qq.com" password:@"****"];
if(!success){
    NSLog(@"error");
}

folder = [account folderWithPath:@"INBOX"];
for (CTCoreMessage *msg in [folder messageObjectsFromIndex:0 toIndex:10]) {
       NSLog(@"%@" , msg.subject);
}

它会提示:

在 for{} 块中找不到 messageObjectsFromIndex:toIndex!

这个方法没有在 MailCode 中定义?

4

1 回答 1

1

尝试messagesFromSequenceNumber:to:withFetchAttributes:改用,如下所示:

for (CTCoreMessage *msg in [folder messagesFromSequenceNumber:1 to:0 withFetchAttributes:CTFetchAttrEnvelope]) {
于 2013-01-23T05:27:32.453 回答