`
374016526
  • 浏览: 95640 次
  • 性别: Icon_minigender_1
  • 来自: 上海
社区版块
存档分类
最新评论
文章列表
UIView* kbView = nil;       NSArray *ws = [[UIApplication sharedApplication] windows];        for(UIView *w in ws){            NSArray *vs = [w subviews];            for(UIView *v in vs){                if([[NSString stringWithUTF8String:object_getClassName(v)] isEqualToString:@"UIP ...
iphone开发中sqlite3的操作说明(转载) ibsqlite3.0.dylib文件地址: /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS2.2.sdk/usr/lib/libsqlite3.0.dylib 2,代码中的操作: 那么接下来是代码了。 1 首先获取iPhone上sqlite3的数据库文件的地址   NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMas ...
  ios开发小知识2(转自cc) 退回输入键盘  - (BOOL)textFieldShouldReturn:(id)textField{    [textField resignFirstResponder];} CGRectCGRect frame = CGRectMake (origin.x,origin.y, size.width, size.height);矩形NSStringFromCGRect(someCG) 把CGRect结构转变为格式化字符串;CGRectFromString(aString) 由字符串恢复出矩形;CGRectInset(aRect) ...
获取所有html:NSString *lJs = @"document.documentElement.innerHTML";获取网页title:NSString *lJs2 = @"document.title";UIWebView *lWebView = [self getCurrentWebView];NSString *lHtml1 = [lWebView stringByEvaluatingJavaScriptFromString:lJs];NSString *lHtml2 = [lWebView stringByEvaluatingJava ...
//放大         CAKeyframeAnimation* animation = [CAKeyframeAnimation animationWithKeyPath:@"transform"];         NSMutableArray *values = [NSMutableArray array];         [values addObject:[NSValue valueWithCATransform3D:CATransform3DMakeScale(0.9f, 0.9f, 1.0f)]];         [values addObj ...
CGMutablePathRef thePath = CGPathCreateMutable();           CGPathMoveToPoint(thePath,NULL,aLayer.position.x, aLayer.position.y - 10);         CGPathAddCurveToPoint(thePath,NULL,                               aLayer.position.x, aLayer.position.y - 30,                               aLayer.posi ...
网易微博上的SDK看上去不太明了,小弟这里对其进行了简单的封装,让大家在使用的时候只需要调用 loin登录 或者 send发送微博即可,好东西共分享.
  开始iPhone的Practise Project,其中有很多的问题,先记录起来,以免以后再犯:         1.  EXC_BAD_ACCESS:       发生场景1:一个指针转了两次,release了两次,其实只要release一次就可以。或者用指针时避免到处赋值。       发生场景2:在一个View Controller A里动态加载另外一个View Controller B, B中无法使用UITableViewDelegate。        2.  Debug里出现一批Leaking的警告错误:      发生场景:使用了NSThread造成的。如下调 ...
 //view 沿中心点旋转  -1逆向旋转 1正向旋转         int direction = -1;         CABasicAnimation* rotationAnimation = [CABasicAnimation animationWithKeyPath:@"transform.rotation.z"];         rotationAnimation.toValue = [NSNumber numberWithFloat:(2 * M_PI) * direction];         rotationAnimation.dur ...

iphone openurl

[ UIApp openURL: [ NSURL URLWithString:@"http://www.apple.com" ] ];   iPhone还包含一些其他除了http://或者mailto:之外的URL: sms:// 可以调用短信程序 tel:// 可以拨打电话 itms:// 可以打开MobileStore.app audio-player-event:// 可以打开iPod audio-player-event://?uicmd=show-purchased-playlist 可以打开iPod播放列表 video-player-event:/ ...
- (void)playPreviewVideo { [UIApplication sharedApplication].statusBarHidden = YES; NSString *urlStr = [[NSBundle mainBundle] pathForResource:@"app" ofType:@"mp4"]; NSURL *url = [NSURL fileURLWithPath:urlStr]; if (!url) { return; } MPMoviePlayerContro ...
1.打开xcode 选择新建Library --- Cocoa touch static Library --- choose --- 命名 2. 新建自己要编写的库文件 3. 实现完成以后编译一下,让后你的库文件就可以使用了

UIViewController理解

关于UIViewContrller的理解: 1.UIViewContrller之间的切换有三种方式: 一、UIViewController自身之间的调用:([self presentModalViewController:UIViewController animated:YES];) 对应的返回操作函数:[self dismissModalViewControllerAnimated:YES];这里的self代表的是UIViewController自己。其可设置四种动画模式: case 0: [ctrl setModalTransitionStyle:UIMod ...
添加照片: 1)打开模拟器,并且确保位于iPhone桌面界面。 2)从计算机桌面把任何图像拖动到iPhone模拟器上。Safari会在模拟器上打开图像并显示(如图2-47所示)。 3)触摸并按住图像。将会弹出一个对话框,允许你把图像保存到Photos应用程序中。
当View离开父窗口之前将Thread结束掉 这样就能有效的管理线程和逻辑处理了   - (void)login { NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; thread = [NSThread currentThread]; sleep(3.0f); if (![thread isCancelled]) { thread = nil; } else { thread = nil; }   [pool release]; }     - (vo ...
Global site tag (gtag.js) - Google Analytics