davresponse libxml/parser.h file not found解决
Add ${SDKROOT}/usr/include/libxml2
as a header search path
Undefined symbols for architecture i386: "_xmlFreeDoc", referenced from:
Go to Target -> Build Phases -> Link Binary with Library, click the plus sign and add "libxml2.dylib"
与头文件有关。是相关的头文件忘记包含进来了。
2、Unknown error finalizing or resetting statement (5: database is locked)
在使用fmdb时有时候一不小心没写好代码就会这样子啦,为什么呢,其实呢,应该是在前面代码中有调用数据库而且并没有调用[db close]就直接跳出结果来了,所以在前面的数据库操作中先运行[db close]再返回数据即可;
3、"$(SRCROOT)"
4、[WARN]Warning: Multiple build commands for output file /Developer/B/Be/build/Release-iphonesimulator/BB.app/no.png
target引用了名字重复的资源
找到当前的target,展开之后,找到Copy Bundle Resources栏目,然后在里面找到重复名字的资源,删除不要的那个即可
5、隐藏小键盘
- - (void)viewDidLoad {
- [super viewDidLoad];
- [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector (doneButtonshow:) name: UIKeyboardDidShowNotification object:nil];
- }
- -(void) doneButtonshow: (NSNotification *)notification {
- doneButton = [UIButton buttonWithType: UIButtonTypeRoundedRect];
- doneButton.frame = CGRectMake(0, 228, 70, 35);
- [doneButton setTitle:@"完成编辑" forState: UIControlStateNormal];
- [doneButton addTarget: self action:@selector(hideKeyboard) forControlEvents: UIControlEventTouchUpInside];
- [self.view addSubview:doneButton];
- }
- -(void) hideKeyboard {
- [doneButton removeFromSuperview];
- [myTextView resignFirstResponder];
- }
6、//修改headertitle
- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section
{
UIView* myView = [[[UIView alloc] init] autorelease];
myView.backgroundColor = [UIColor clearColor];
UILabel *titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(10, 0, 90, 22)];
titleLabel.textColor=[UIColor whiteColor];
titleLabel.backgroundColor = [UIColor clearColor];
titleLabel.text=[keys objectAtIndex:section];
[myView addSubview:titleLabel];
[titleLabel release];
return myView;
}
需要注意的一点是:这个方法里返回视图的大小是固定不变的
The table view automatically adjusts the height of the section header to accommodate the returned view object. The table view does not call this method if it was created in a plain style (UITableViewStylePlain).要改变高度,需要重写:
- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection
}
7、 UINavgationBar提供了titleTextAttributes 属性来简单的设置其title样式,titleTextAttributes是一个NSDictionary类型,包含的固定的属性名称,可以用来设置title的样式,指定的属性keys声明于NSString UIKit Additions Reference扩展中,包括:
1 | NSString * const UITextAttributeFont,设置title的文字字体; |
2 | NSString * const UITextAttributeTextColor,设置title的文字颜色; |
3 | NSString * const UITextAttributeTextShadowColor,设置titlewz的阴影颜色; |
4 | NSString * const UITextAttributeTextShadowOffset,设置titlewz阴影的平移量 ; |
如,设置title样式为:系统默认bold类型20号红色字体,阴影颜色为白色,右下偏移2像素
1 | NSDictionary *navTitleArr = [NSDictionary dictionaryWithObjectsAndKeys: |
2 | [UIFont boldSystemFontOfSize:20],UITextAttributeFont, |
3 | [UIColor redColor],UITextAttributeTextColor , |
4 | [NSValue valueWithCGSize:CGSizeMake(2.0, 2.0)] , UITextAttributeTextShadowOffset , |
5 | [UIColor whiteColor] ,UITextAttributeTextShadowColor , |
6 | nil]; |
7 | [navBar setTitleTextAttributes:navTitleArr]; |