摘要: Cocoa提供了一个类NSPredicate类,该类主要用于指定过滤器的条件,该对象可以准确的描述所需条件,对每个对象通过谓词进行筛选,判断是否与条件相匹配。谓词表示计算真值或假值的函数。 NSPredicate*predicate; predicate=[NSPredicatepredicateWithFormat:@"name=='Herbie'"];//用predicateWithFormat创建一个谓词,name作为键路径 BOOLmatch=[predicateevaluateWithObject:car];//car作为接收对象,evaluate 阅读全文
posted @ 2013-09-30 12:15 Orangeづ 阅读(285) 评论(0) 推荐(0)
摘要: 应用程序边框大小 我们应该使用"bounds"来获得应用程序边框,而不是用"applicationFrame"。"applicationFrame"还包含了一个20像素的status bar。除非我们需要那额外的20像素的status bar。 Web view UIWebView类的调用.CGRect webFrame = CGRectMake(0.0, 0.0, 320.0, 460.0);UIWebView *webView = [[UIWebView alloc] initWithFrame:webFrame];[webVie 阅读全文
posted @ 2013-09-28 16:53 Orangeづ 阅读(173) 评论(0) 推荐(0)
摘要: NSXMLParser解析xml格式的数据 用法如下:首先,NSXMLParser必须继续NSXMLParserDelegate协议@interface XMLHelper : NSObject 首先设置XML数据,并初始化NSXMLParser- (void)viewDidLoad {NSMutableString *Strxml=[NSMutableString stringWithString:@"111111113333333333"];NSData *data=[NSData dataWithBytes:[Strxml UTF8String] length:[St 阅读全文
posted @ 2013-09-13 16:04 Orangeづ 阅读(140) 评论(0) 推荐(0)