IOS开发各种

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"

use of undeclared identifier

与头文件有关。是相关的头文件忘记包含进来了。

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、隐藏小键盘

  1. - (void)viewDidLoad {  
  2.    [super viewDidLoad];  
  3.   
  4.    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector (doneButtonshow:) name: UIKeyboardDidShowNotification object:nil];  
  5. }  
  1. -(void) doneButtonshow: (NSNotification *)notification {  
  2.    doneButton = [UIButton buttonWithType: UIButtonTypeRoundedRect];  
  3.    doneButton.frame = CGRectMake(0, 228, 70, 35);  
  4.    [doneButton setTitle:@"完成编辑" forState: UIControlStateNormal];  
  5.    [doneButton addTarget: self action:@selector(hideKeyboard) forControlEvents: UIControlEventTouchUpInside];  
  6.   
  7.    [self.view addSubview:doneButton];  
  8. }

  1. -(void) hideKeyboard {  
  2.    [doneButton removeFromSuperview];  
  3.    [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:(NSInteger)section{
    return 30;
}

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];


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值