摘要: controller里做翻转动画1.UIModalTransitionStyleFlipHorizontal比如:自定FlipViewController,和nib文件FlipView在调用的controller里实现以下程序FlipViewController *controller = [[FlipViewController alloc] initWithNibName:@"FlipView" bundle:nil]; controller.delegate = self; controller.modalTransitionStyle = UIModalTransi 阅读全文
posted @ 2012-07-23 15:08 月光的尽头 阅读(7435) 评论(0) 推荐(0) 编辑
摘要: 用来存储用户偏好数据,生成 .plist文件保存到iphone,在 app同级目录的/Library/Preferences目录下数据采用键值对的方式访问和设置使用时候可以自定义一个单列模式的类,比如UserPreference,封装调用1.先定义一些键,可以随便定义,比如static NSString *kUserNameKey = @"test-key1";2.取数据的方法,比如取字符串NSString *userName = [[[NSUserDefaults standardUserDefaults] stringForKey:kUserNameKey] retai 阅读全文
posted @ 2012-07-13 13:32 月光的尽头 阅读(1961) 评论(0) 推荐(0) 编辑
摘要: 警告提示视图NSString *content = NSLocalizedString(@"this is test alert message", nil);UIAlertView *alert = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"alert title", nil) message:content delegate... 阅读全文
posted @ 2012-07-12 18:34 月光的尽头 阅读(2225) 评论(0) 推荐(0) 编辑
摘要: 获取每段子字符串数组,字符串被指定的字符分割(比如"\r\n")NSArray *arr = [testStr componentsSeparatedByString:@"\r\n"];字符串替换NSString *str =[testStr stringByReplacingOccurrencesOfString:@"\\n" withString:@"\r\n"];获取字符串@"testKey=testValue"中的key和valueNSString *testStr = @"t 阅读全文
posted @ 2012-07-12 16:27 月光的尽头 阅读(577) 评论(0) 推荐(0) 编辑
摘要: 前提是调试或发布时,证书已经启动了push服务1.注册远程通知类型UIRemoteNotificationType apn_type = (UIRemoteNotificationType)(UIRemoteNotificationTypeAlert|UIRemoteNotificationTypeSound|UIRemoteNotificationTypeBadge);[[UIApplication sharedApplication] registerForRemoteNotificationTypes:apn_type]; 2.实现appDelegate的委托方法- (void)appl 阅读全文
posted @ 2012-07-12 14:54 月光的尽头 阅读(3592) 评论(0) 推荐(0) 编辑
摘要: 当app重新打开或切换到前台时,在app委托applicationWillEnterForeground:方法里实现清除泡泡计数- (void)applicationWillEnterForeground:(UIApplication *)application{ // clear badage [[UIApplication sharedApplication] setApplicationIconBadgeNumber:0];}在app被激活时,设置泡泡计数- (void)applicationDidBecomeActive:(UIApplication *)applicati... 阅读全文
posted @ 2012-07-12 13:06 月光的尽头 阅读(511) 评论(0) 推荐(0) 编辑
摘要: #!/bin/bash#code by xiaodao 2012-06-05sourceipaname="test.ipa"appname="test.app"targetName="test"version="1_2_0"zipTime=`date +%m_%d`PlistBuddy="/usr/libexec/PlistBuddy"plutil="plutil"source="channel"distDir="${PWD}/pkg" 阅读全文
posted @ 2012-07-12 11:54 月光的尽头 阅读(587) 评论(0) 推荐(0) 编辑
摘要: 一、获取系统的错误信息比如移动文件时,获取文件操作错误:NSError *e = nil;[[NSFileManager defaultManager] moveItemAtPath:sourcePath toPath:targetPath error:&e];if (e) { NSLog(@"move failed:%@", [e localizedDescription]);}先定一个空的错误信息NSError *e = nil;取地址&e 如果有错误信息,打印错误的本地化描述if (e) { NSLog(@"move failed:%@&qu 阅读全文
posted @ 2012-07-04 15:21 月光的尽头 阅读(54367) 评论(2) 推荐(2) 编辑
摘要: 1.获取app的info.plist详细信息版本号:Bundle version NSString *version = [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleVersion"];应用标识:Bundle identifierNSString *bundleId = [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleIdentifier"];应用名称:Bundle display nameNSS 阅读全文
posted @ 2012-07-03 14:34 月光的尽头 阅读(9002) 评论(0) 推荐(2) 编辑
摘要: 安装Mercurial在命令行中输入:sudo easy_install mercurial然后输入管理员密码,自动下载并安装然后就可以用hg更新源代码了例如:hg clone https://code.google.com/p/core-plot/ 阅读全文
posted @ 2012-04-25 17:00 月光的尽头 阅读(6795) 评论(0) 推荐(0) 编辑