2 yue1liang1chuan yue1liang1chuan 于 2013.01.23 14:58 提问

用mailCode写邮箱客户端时出问题

用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);
}

运行之后就会提示:

In the for{} block messageObjectsFromIndex:toIndex not found!

是不是这个方法没在MailCode中?

1个回答

redCoral_
redCoral_   2013.01.23 15:47
已采纳

messagesFromSequenceNumber:to:withFetchAttributes:
代码应该是这样:

for (CTCoreMessage *msg in [folder messagesFromSequenceNumber:1 to:0 withFetchAttributes:CTFetchAttrEnvelope]) {
Csdn user default icon
上传中...
上传图片
插入图片
准确详细的回答,更有利于被提问者采纳,从而获得C币。复制、灌水、广告等回答会被删除,是时候展现真正的技术了!