Fork me on GitHub
上一页 1 ··· 91 92 93 94 95 96 97 98 99 ··· 125 下一页

2012年2月16日

摘要: 方法一:-(void) viewDidLoad{[self performSelectorInBackground:@selector(call1) withObject:nil]; }-(void) call1{timer1 = [NSTimer scheduledTimerWithTimeInterval:3.0 target:self selector:@selector(doSomething) userInfo:nil repeats:NO]; [[NSRunLoop currentRunLoop] addTimer:timer1 forMode:NSRunLoopCommonMod 阅读全文
posted @ 2012-02-16 15:52 pengyingh 阅读(250) 评论(0) 推荐(0)
摘要: 第一种方式.New Project -> IOS Library ->Cocoa touch Static Library 这样就新建了一个静态库的工程,将你要打包成lib的.m,.h放到class目录下面,然后build就可以了. 打包的时候要分清楚是debug,release.第二种方式1.在工程的Targets上右键.Add -> New Target ->Static Library 比如我们建了一个example的target2.将你要打包的.m.h放到自己新建的文件夹里面.一个一个的选中.m.h,然后右键Get Info,Taggets.选择example, 阅读全文
posted @ 2012-02-16 15:44 pengyingh 阅读(129) 评论(0) 推荐(0)
摘要: NSURLRequest*request =[NSURLRequest requestWithURL:[NSURL URLWithString:@"http://www.google.com/"]];NSURLConnection*connection =[NSURLConnection connectionWithRequest:request delegate:self];-(void)connection:(NSURLConnection*)connection didReceiveResponse:(NSURLResponse*)response{ NSHTTPUR 阅读全文
posted @ 2012-02-16 15:38 pengyingh 阅读(876) 评论(0) 推荐(0)
摘要: 原文地址:http://blog.csdn.net/ikmb/article/details/6716831一 objective-c调用jsNSString*currentURL=[webViewstringByEvaluatingJavaScriptFromString:@"document.location.href"];//注:webView是UIWebView实例二 js调用objective-c1.obj-c部分-(void)viewDidLoad{[superviewDidLoad];self.myWebView.delegate=self;}//------ 阅读全文
posted @ 2012-02-16 15:31 pengyingh 阅读(2493) 评论(0) 推荐(0)
摘要: NSLog(@"Hello, World!"); NSDictionary *myDic=[[NSDictionary alloc]initWithObjectsAndKeys:@"张三",@"name",@"李四",@"name", nil]; NSUInteger count = [myDic count]; NSLog(@"词典的数量为: %lu",count); NSEnumerator * myEnumerator = [myDic keyEnumerator]; 阅读全文
posted @ 2012-02-16 15:18 pengyingh 阅读(6552) 评论(0) 推荐(0)
摘要: 格式化日期字符串,copy一份常用参数:a: AM/PM (上午/下午)A: 0~86399999 (一天的第A微秒)c/cc: 1~7 (一周的第一天, 周天为1)ccc: Sun/Mon/Tue/Wed/Thu/Fri/Sat (星期几简写)cccc: Sunday/Monday/Tuesday/Wednesday/Thursday/Friday/Saturday (星期几全拼)d: 1~31 (月份的第几天, 带0)D: 1~366 (年份的第几天,带0)e: 1~7 (一周的第几天, 带0)E~EEE: Sun/Mon/Tue/Wed/Thu/Fri/Sat (星期几简写)EEEE: 阅读全文
posted @ 2012-02-16 15:07 pengyingh 阅读(3799) 评论(0) 推荐(0)
摘要: 如果视图的autoresizesSubviews属性声明被设置为YES,则其子视图会根据autoresizingMask属性的值自动进行尺寸调整。简单配置一下视图的自动尺寸调整掩码常常就能使应用程序得到合适的行为;否则,应用程序就必须通过重载layoutSubviews方法来提供自己的实现。 self.autoresizingMask = UIViewAutoresizingFlexibleWidth;//这个常量如果被设置,视图的宽度将和父视图的宽度一起成比例变化。否则,视图的宽度将保持不变。 UIViewAutoresizingNone这个常量如果被设置,视图将不进行自动尺寸调整。... 阅读全文
posted @ 2012-02-16 15:06 pengyingh 阅读(2285) 评论(0) 推荐(0)
摘要: 从远程下载图片到UIImage,然后再180度转换图片 1 #import <Foundation/Foundation.h> 2 #define TIMEOUT_SEC 20.0 3 4 @interface TSHttpClient : NSObject { 5 NSURLConnection *connection; 6 NSMutableData *recievedData; 7 int statusCode; 8 BOOL contentTypeIsXml; 9 10 int rate_limit;11 ... 阅读全文
posted @ 2012-02-16 15:03 pengyingh 阅读(768) 评论(0) 推荐(0)
摘要: ASIHTTPRequest用法不多介绍,网上一堆,实例如图1 #import <UIKit/UIKit.h>2 #import "MainView.h"3 4 @interface AppDelegate : UIResponder <UIApplicationDelegate>5 6 @property (strong, nonatomic) UIWindow *window;7 @property (strong, retain) MainView *viewController;8 9 @end复制代码 1 - (void)dealloc 2 阅读全文
posted @ 2012-02-16 14:44 pengyingh 阅读(1551) 评论(0) 推荐(0)
摘要: 网页上面常用的Jquery广告控件(slideshow)是通过div+jquery来实现,ios上面实现主要通过UIPageControl+UIScrollView来结合实现,效果如下图:源码如下:1 #import <Foundation/Foundation.h>2 @class SlideView;3 4 @protocol SlideScrollDelegate <NSObject>5 6 -(void)slideshowDidChangeCurrentView:(SlideView *)slideview CurrentPage:(int) currentPa 阅读全文
posted @ 2012-02-16 14:42 pengyingh 阅读(194) 评论(0) 推荐(0)
上一页 1 ··· 91 92 93 94 95 96 97 98 99 ··· 125 下一页

导航