UISearchBar相关-------------------
UISearchBar*sb=[[UISearchBar alloc]
initWithFrame:CGRectMake(0.0f, 0.0f, 320.0f, 44.0f)];//设置搜索框
self.searchBar.keyboardType=UIKeyboardTypeAlphabet;//键盘样式设置
self.searchBar.text
UIColor相关------------------------------
UIColor*color=[[UIColor alloc]
initWithPatternImage:[UIImageimageNamed:@"bg.jpg"]];
//UIImage到UIColor的转换,用图像做背景的很重要步骤
UIColor*color=[UIColor
colorWithRed:111/255 green:222/255 blue:333/255 alpha:1.0f];
//RGB颜色
UIColor*color=[UIColor clearColor]//透明色
读取文件------------------------------
//读取文本文件
[[NSBundle mainBundle] bundlePath]
NSString*path=[[NSBundle mainBundle]
pathForResource:@"1" ofType:@"txt"];
NSError*error;
NSString*contenString=[NSString
stringWithContentsOfFile:path
encoding:NSUTF8StringEncoding
error:&error];
if(nil==contenString) {
NSLog(@"error:%@",error);
returnnil;
}
returncontenString;
//读取plistxml文件
NSString *dataPath = [[NSBundlemainBundle]
pathForResource:@"Data"ofType:@"plist"];
self.data = [NSArrayarrayWithContentsOfFile:dataPath];
//读取文件总结,是先用mainBundle 获取路径,然后用xxxWithContentsOfFile