摘要: mainFrame = [[Test_Book1_2_Classes_ViewController alloc] init]; CATransition *transition = [CATransition animation]; transition.duration = 1.0f; /* 间隔时间*/ transition.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut]; /* 动画的开始与结束的快慢*/ ... 阅读全文
posted @ 2011-09-25 09:22 威尚 阅读(481) 评论(0) 推荐(0) 编辑
摘要: //// touchViewController.m// touch//// Created by joe visen on 11-9-21.// Copyright 2011 mjrj.com. All rights reserved.//#import "touchViewController.h"@implementation touchViewController- (void)loadView{ [super loadView]; UILongPressGestureRecognizer *longPressGesture = [[UILongPressGestu 阅读全文
posted @ 2011-09-21 23:52 威尚 阅读(4154) 评论(0) 推荐(0) 编辑
摘要: //显示进度滚轮指示器-(void)showWaiting:(UIView *)parent { int width = 32, height = 32; CGRect frame = CGRectMake(100, 200, 110, 70) ;//[parent frame]; //[[UIScreen mainScreen] applicationFrame]; int x = frame.size.width; int y = frame.size.height; frame = CGRectMake((x - width) / 2, (... 阅读全文
posted @ 2011-09-11 16:40 威尚 阅读(932) 评论(3) 推荐(0) 编辑
摘要: 方案一:#import "xmlViewController.h"@implementation xmlViewControllerstatic NSString *feedURLString = @"http://headlines.yahoo.co.jp/rss/sci.xml";- (void)parserDidStartDocument:(NSXMLParser *)parser{ // 解析开始时的处理}- (void)parseXMLFileAtURL:(NSURL *)URL parseError:(NSError **)error{ NS 阅读全文
posted @ 2011-09-04 11:33 威尚 阅读(852) 评论(0) 推荐(0) 编辑
摘要: 文章来自:http://www.cocoachina.com/bbs/read.php?tid-31300.html一:确认网络环境3G/WIFI1. 添加源文件和framework开发Web等网络应用程序的时候,需要确认网络环境,连接情况等信息。如果没有处理它们,是不会通过Apple的审(我们的)查的。Apple 的 例程 Reachability 中介绍了取得/检测网络状态的方法。要在应用程序程序中使用Reachability,首先要完成如下两部:1.1. 添加源文件:在你的程序中使用Reachability 只须将该例程中的 Reachability.h 和 Reachability.m 阅读全文
posted @ 2011-08-22 18:22 威尚 阅读(725) 评论(0) 推荐(1) 编辑
摘要: 1)创建一个新的基于视图的应用程序,将其保存为URLSchemeExample。2)在Xcode Groups & Files面板中,展开Resource部分,并且选择<app>-Info.plist文件。3)鼠标右键点击Information Property List键,并点击添加箭头从列表中选择“URLtypes”(如图3-17所示)。4)展开Item 1,用鼠标右键点击URLidentifier,并且再次选择添加箭头从列表中选择URLSchemes(如图3-18所示)。图3-16 启动Maps应用程序并查找披萨店(点击查看大图)图3-17 添加一个URL类型图3-1 阅读全文
posted @ 2011-08-22 16:29 威尚 阅读(1532) 评论(0) 推荐(0) 编辑
摘要: 比如你建立的工程为aFile, 正常编译出一个aFile.app文件, 右键, 显示包内容, 将里面的可执行文件aFile, 修改名字为aFile_, 再将你的引导程序改成aFile, 这样安装之后, 点击图标系统就会自动调用你的引导程序. 引导程序的编写很简单, 大体为int main(int argc, char *argv[]) { NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; NSString* string = [[NSBundle mainBundle] pathForRe... 阅读全文
posted @ 2011-08-22 10:58 威尚 阅读(1338) 评论(0) 推荐(0) 编辑
摘要: 首先,必须确定iPhone是越狱的,并且你的下面代码运行的目录为/Applications/. NSFileManager* fileManager = [NSFileManager defaultManager]; NSMutableArray* applist = [NSMutableArray arrayWithCapacity:10]; for (NSString *path in [fileManager directoryContentsAtPath:@"/var/mobile/Applications"]) { for (NSString *sub... 阅读全文
posted @ 2011-08-22 08:43 威尚 阅读(1420) 评论(0) 推荐(0) 编辑
摘要: 创建与删除: //创建文件管理器 NSFileManager *fileManager = [NSFileManager defaultManager]; //获取路径 //参数NSDocumentDirectory要获取那种路径 NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); NSString *documentsDirectory = [paths objectAtIndex:0];//去处需要的路径 //更改到待操作的目录下 [fileMan 阅读全文
posted @ 2011-08-17 18:35 威尚 阅读(665) 评论(0) 推荐(0) 编辑
摘要: NSUserDefaults读取和写入自定义对象 NSUserDefaults可以存取一些短小的信息。比如存入再读出一个字符串到NSUserDefaults: view plaincopy to clipboardprint?NSString *string = [NSString stringWithString @"hahaha"]; NSUserDefaults *ud = [NSUserDefaults standardUserDefaults]; [ud setObject:string forKey:@"myKey"]; NSString * 阅读全文
posted @ 2011-08-17 18:30 威尚 阅读(882) 评论(0) 推荐(0) 编辑