zl4393753 发表于 2013-1-30 01:06:46

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为你的ApplicationDelegateAppDelegate:UIWindow *localWindow = [ initWithFrame: [ bounds]];localWindow.backgroundColor = ;self.window = localWindow;;navigationController = [ initWithRootViewController:[ init]];];;
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 = ];

grouped tableview:
;
init] autorelease]];
;
//设置底色为无色

9 工具栏居中
//添加底部拍照的工具栏      //左空格      UIBarButtonItem *leftflexible = [ initWithBarButtonSystemItem:UIBarButtonSystemItemFlexibleSpace target:nil action:nil];      //右空格      UIBarButtonItem *rightflexible = [ initWithBarButtonSystemItem:UIBarButtonSystemItemFlexibleSpace target:nil action:nil];      UIBarButtonItem *cameraitem = [[ initWithBarButtonSystemItem:UIBarButtonSystemItemCamera target:self action: @selector(beginScan)] autorelease];   NSArray *myToolbarItems = [ initWithObjects: leftflexible,cameraitem,rightflexible, nil];                   ;
页: [1]
查看完整版本: iphone开发备忘