5
我正在阅读RSS feed到nsmutablearray。我想搜索xml提要。因为我想搜索nsmutablearray。我对iphone应用程序很陌生。可有一个人helpme这个..如何在目标c-iPhone应用程序中搜索nsmutablearray
感谢,
我正在阅读RSS feed到nsmutablearray。我想搜索xml提要。因为我想搜索nsmutablearray。我对iphone应用程序很陌生。可有一个人helpme这个..如何在目标c-iPhone应用程序中搜索nsmutablearray
感谢,
你可以使用谓词阵列的“搜索”,像这样:
NSMutableArray* names = [NSMutableArray arrayWithObjects:@"Andy", @"Bart", @"Bob", nil];
NSPredicate* predicate = [NSPredicate predicateWithFormat:@"SELF beginswith[c] 'b'"];
NSArray* namesStartingWithB = [names filteredArrayUsingPredicate: predicate];
// namesStartingWithB now contains @"Bart" & @"Bob"
你应该看看NSArray和NSPredicate文档了解更多信息。如果您想了解解析XML(即RSS提要)的具体信息,则应查看Matt Gallagher的文章using libxml2 for XML parsing and XPath queries in Cocoa。
添加文档链接 – 2009-07-01 05:18:42