1. 添加sqlite框架的路径如下:
/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.0.sdk/usr/libsqlite3.dylib
2. iPhone开发不使用xib文件的方法:
修改main.m里的UIApplicationMain参数为
UIApplicationMain(argc, argv, nil, @"AppDelegate");
// AppDelegate为你的ApplicationDelegate
AppDelegate:
UIWindow *localWindow = [[UIWindow alloc] initWithFrame: [[UIScreen mainScreen] bounds]];
localWindow.backgroundColor = [UIColor whiteColor];
self.window = localWindow;
[localWindow release];
navigationController = [[UINavigationController alloc] initWithRootViewController:[[HomeViewController alloc] init]];
[window addSubview:[navigationController view]];
[window makeKeyAndVisible];
3. SQLITE建表语句
CREATE TABLE accountbook(id integer primary key autoincrement,
price number,
costtime date,
categorycode varchar(2),
categoryname varchar(20),
year varchar(4),
month varchar(2),
day varchar(2));
4. linux/MAC下强制结束进程
ps -ef //查看进程号
kill -9 进程号 //强制结束
5. iphone程序设置启动横屏
只要在Info.plist里面加UIInterfaceOrientation
给个 UIInterfaceOrientationLandscapeRight 就可以了
6. 彩色UIProgressView
http://pwiddershoven.nl/blog/2009/01/04/colored-uiprogressview.html
7. Cover Flow Effect
http://blog.objectgraph.com/index.php/2010/04/09/how-to-add-coverflow-effect-on-your-iphone-app-openflow/
8. 设置uitableview backgroundcolor:
正常情况下:
self.tableView.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"BackgroundPattern.png"]];
grouped tableview:
[tableView setBackgroundView: nil];
[tableView setBackgroundView: [[[UIView alloc] init] autorelease]];
[tableView setBackgroundColor: UIColor.clearColor];
//设置底色为无色
9 工具栏居中
//添加底部拍照的工具栏
//左空格
UIBarButtonItem *leftflexible = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFlexibleSpace target:nil action:nil];
//右空格
UIBarButtonItem *rightflexible = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFlexibleSpace target:nil action:nil];
UIBarButtonItem *cameraitem = [[[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemCamera target:self action: @selector(beginScan)] autorelease];
NSArray *myToolbarItems = [[NSArray alloc] initWithObjects: leftflexible,cameraitem,rightflexible, nil];
[self setToolbarItems: myToolbarItems animated:YES];