上一页 1 ··· 4 5 6 7 8 9 10 11 12 下一页

frame 和bounds

摘要: CGRect bounds = [[UIScreen mainScreen] bounds]; //bounds是uiview自身的坐标,frame是父uiview的坐标,center是uiview中心在父uiview(superview)的坐标 int screenWidth = bounds.size.width; int screenHeight = bounds.size.height; CGRect frame = CGRectMake((screenWidth-312)/2, (screenHeight-312)/2, 312, 312);//从第一个到第四个分别是: x坐标,y. 阅读全文
posted @ 2012-04-19 12:04 爱直至成伤lie 阅读(476) 评论(0) 推荐(0) 编辑

基本的Random函数

摘要: Random函数 Math.random(); 可以产生出0-1之间的任意小数,例如0.0105901374530933 或 0.872525005541986,有几个其他的函数可以用来改变产生的数字,从而可以更好的在你的影片中使用: Math.round(); Math.ceil(); Math.floor(); 这几个函数都是用来取得整数的,Math.round();是采用四舍五入方式取得最接近的整 数。Math.ceil();是向上取得一个最接近的整数。Math.floor(); 和Math.ceil();相反,Math.floor();向下取得一个最接近的整数... 阅读全文
posted @ 2012-04-18 17:13 爱直至成伤lie 阅读(477) 评论(0) 推荐(0) 编辑

在NSString中找到数字转换成int

摘要: Question:I have an NSString like so:@"200hello"or@"0 something"What I would like to be able to do is take the first occuring number in the NSString and convert it into an int.So that @"200hello" would become int = 200.and @"0 something" would become int = 0.An 阅读全文
posted @ 2012-04-17 15:26 爱直至成伤lie 阅读(1754) 评论(0) 推荐(0) 编辑

给图片赋值 用代码

摘要: 比如:UIImageView *imageView = [[UIImageView alloc] init]; [self.view addSubview:imageView]; imageView.image = [UIImage imageNamed:@"1chargedbar_w_75-px.png"]; } 阅读全文
posted @ 2012-04-13 17:14 爱直至成伤lie 阅读(205) 评论(0) 推荐(0) 编辑

iOS隐藏键盘代码

摘要: iOS隐藏键盘代码 在View的UITextField中经常需要输入完文字后隐藏软键盘,要实现着一点要让View的Controller实现UITextFieldDelegate代理,然后编写相应的代码。#import <UIKit/UIKit.h>@interface TestVeiwController : UIViewController<UITextFieldDelegate> {IBOutlet UITextField *txt;}@property (nonatomic,retain) UITextField *txt;@end然后记得要指定文本框的代理- ( 阅读全文
posted @ 2012-04-13 16:03 爱直至成伤lie 阅读(11215) 评论(0) 推荐(0) 编辑

thread 1:Program received signal: "SIGABRT" 什么原因?

摘要: 调用了不存在的方法 阅读全文
posted @ 2012-04-13 09:53 爱直至成伤lie 阅读(1137) 评论(1) 推荐(0) 编辑

IOS开发基础之──NSLog 输出格式详解

摘要: • %@ 对象 • %d, %i 整数 • %u 无符整形 • %f 浮点/双字 • %x, %X 二进制整数 • %o 八进制整数 • %zu size_t • %p 指针 • %e 浮点/双字 (科学计算) • %g 浮点/双字 • %s C字符串 • %.*s Pascal字符串 • %c 字符 • %C unichar • %lld 64位长整数(long long) • %llu 无符64位长整数 • ... 阅读全文
posted @ 2012-04-13 09:02 爱直至成伤lie 阅读(294) 评论(2) 推荐(0) 编辑

iphone开发中sqlite3的操作说明(转载)

摘要: ibsqlite3.0.dylib文件地址:/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS2.2.sdk/usr/lib/libsqlite3.0.dylib2,代码中的操作:那么接下来是代码了。1 首先获取iPhone上sqlite3的数据库文件的地址NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);NSString *documentsDirectory = [paths 阅读全文
posted @ 2012-04-09 14:09 爱直至成伤lie 阅读(274) 评论(0) 推荐(0) 编辑

从数据库sqlite3读取数据

摘要: #include <stdio.h> #include <sqlite3.h> #include <stdlib.h> #define _DEBUG_ int main( void ) {sqlite3 *db=NULL;//声明sqlite关键结构指针 char *zErrMsg = 0; int rc; //打开或创建一个数据库文件 rc = sqlite3_open("query.db", &db); //打开指定的数据库文件,如果不存在,将创建一个同名的数据库文件,需要传入db这个指针的指针,因为sqlite3_open函 阅读全文
posted @ 2012-04-09 13:49 爱直至成伤lie 阅读(12345) 评论(0) 推荐(0) 编辑

sqlite3 数据库读取

摘要: (void)StartTutorial:(int)idInt{NSLog(@"start %d",idInt);//indicator指示器[activityIndicator startAnimating];[nextToneArray removeAllObjects];[rhythmTutorialArray removeAllObjects];//database codingNSString *path=[NSString stringWithFormat:@"%@%@",[[NSBundle mainBundle] resourcePath] 阅读全文
posted @ 2012-04-09 12:57 爱直至成伤lie 阅读(1292) 评论(0) 推荐(0) 编辑
上一页 1 ··· 4 5 6 7 8 9 10 11 12 下一页