iphone开发备忘

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];
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值