好岸园IT技术学习网 hopean.com IT新闻 js网页特效 it技术 二次开发

随笔分类 -  iphone开发

摘要:iphone 使用 soap 服务 介绍目前比较常用的有几个办法:1. WSDL to Objective C自动根据wsdl文件生成ios可以直接调用的Objective-C (Cocoa) 代码具体使用和介绍请见:http://code.google.com/p/wsdl2objc/2. WSDL to Objective C SUDZC一个在线服务,主要用于根据wsdl服务或者文件生成Objective-C (Cocoa) 代码具体使用和介绍请见:http://sudzc.com/3. WSDL to C CSOAPCSOAP 是一个 c/s结构的类包具体使用和介绍请见:http://c 阅读全文
posted @ 2013-09-04 14:36 hopeanCom 阅读(396) 评论(0) 推荐(0)
摘要:IOS:NSNotification1. 通知中心概述通知中心实际上是在程序内部提供了消息广播的一种机制。通知中心不能在进程间进行通信。实际上就是一个二传手,把接收到的消息,根据内部的一个消息转发表,来将消息转发给需要的对象。通知中心是基于观察者模式的,它允许注册、删除观察者。一个NSNotificationCenter可以有许多的通知消息NSNotification,对于每一个NSNotification可以有很多的观察者Observer来接收通知。2. 通知中心两个重要的类NSNotificationCenter:这是iOS中通知中心的灵魂,由该类实现了观察者模式,并给开发者提供了诸如注册 阅读全文
posted @ 2013-04-27 14:08 hopeanCom 阅读(472) 评论(0) 推荐(0)
摘要:NSString * path = [[NSBundle mainBundle]pathForResource:@"alien" ofType:@"png"]; UIImage *image = [[UIImage alloc] initWithContentsOfFile:path]; NSString* path2 = [[NSBundle mainBundle]pathForResource:@"spider" ofType:@"png"]; UIImage * image2 =[[UIImage alloc 阅读全文
posted @ 2013-04-25 09:16 hopeanCom 阅读(1429) 评论(0) 推荐(0)
摘要:[UIApplication sharedApplication].networkActivityIndicatorVisible = YES; //显示[UIApplication sharedApplication].networkActivityIndicatorVisible = NO; //隐藏让状态栏显示网络等待标志状态栏是可以通过UIApplication类提供的一些方法来修改的,比如完全去掉状态栏或者修改风格,不过这些改变只是在你的程序内部,当你退出你的程序又会复原。UIApplication *myApp = [UIapplication sharedApplication] 阅读全文
posted @ 2013-04-19 09:02 hopeanCom 阅读(252) 评论(0) 推荐(0)
摘要:autocapitalizationType设置键盘自动大小写的属性 UITextAutocapitalizationTypeNoneautocorrectionType property设置是否有自动修改提示 UITextAutocorrectionTypeNoenablesReturnKeyAutomaticallyBoolean值-设置在用户没有输入是returnKey禁用,默认值NO keyboardAppearance设置键盘显示方式 除了默认模式 还有一个UIKeyboardAppearanceAlert模式keyboardType设置键盘类型 UIKeyboardTypePhon 阅读全文
posted @ 2013-04-17 15:00 hopeanCom 阅读(1089) 评论(0) 推荐(0)
摘要:有时候我们可能需要复制UILabel上的文本,或者UIImageView的图片,而UILabel和UIImageView默认是不响应Touch事件的,也无法复制,那么我们就需要自己实现一个可复制的UILabel。新添加一个类继承自UILabel:[cpp] view plaincopyprint?@interfaceUICopyLabel:UILabel@end@interface UICopyLabel : UILabel@end[cpp] view plaincopyprint?#import"UICopyLabel.h" @implementationUICopyLa 阅读全文
posted @ 2013-04-17 13:48 hopeanCom 阅读(758) 评论(0) 推荐(0)
摘要:1. Menu所处的View必须实现 – (BOOL)canBecomeFirstResponder, 且返回YES2. Menu所处的View必须实现 – (BOOL)canPerformAction:withSender, 并根据需求返回YES或NO3. 使Menu所处的View成为First Responder (becomeFirstResponder)4. 定位Menu (- setTargetRect:inView:)5. 展示Menu (- setMenuVisible:animated:)[cpp] view plaincopyprint?@implementationUICo 阅读全文
posted @ 2013-04-17 13:46 hopeanCom 阅读(515) 评论(0) 推荐(0)
摘要:当苹果在 iOS 3.0 中增加了剪切、复制和粘贴功能时,它同时为开发者提供了 UIMenuController 组件用来定制该弹出菜单,但不幸的是,最开始的实现要很麻烦:附加在菜单的视图的 canBecomeFirstResponser 必须返回 YES,这意味着必须子类化。例如最常用的显示元素 UITableViewCell 和 UILabel 默认返回的是 NOUILongPressGestureRecognizer直到 iOS 3.2 才提供, which means that the long press to initiate the menu display had to be 阅读全文
posted @ 2013-04-17 13:36 hopeanCom 阅读(431) 评论(0) 推荐(0)
摘要:将字符串切割成数组- (void)viewDidLoad{ NSString *a = [[NSStringalloc] initWithString :@"冬瓜,西瓜,火龙果,大头,小狗" ]; NSArray *b = [a componentsSeparatedByString:@","]; NSString *a3 = [b objectAtIndex:2]; NSLog(@"\n b的第三个东东是: %@",a3); [a release];}2011-07-12 18:45:12.682 Q[8778:207] b的第三个 阅读全文
posted @ 2013-04-17 09:39 hopeanCom 阅读(903) 评论(0) 推荐(0)
摘要:对于iPhone app,UIViewController类提供了基本的视图管理模式。当设备改变方向的时候view controller的视图会自动随之旋转的。如果视图和子视图的autoresizing属性设置是对的,这时候视图又没有随着设备一起旋转,可能是以下的原因:1.view controller没有完成代理方法- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation;也要实现了shouldAutorotateToInterfaceOrientation方法,同时 阅读全文
posted @ 2013-04-17 09:21 hopeanCom 阅读(246) 评论(0) 推荐(0)
摘要:UITapGestureRecognizerUIPinchGestureRecognizerUIRotationGestureRecognizerUISwipeGestureRecognizerUIPanGestureRecognizerUILongPressGestureRecognizer从命名上不难了解這些类別所对应代表的手势,分別是 Tap(点一下)、Pinch(二指往內或往外拨动)、Rotation(旋转)、Swipe(滑动,快速移动)、Pan (拖移,慢速移动)以及 LongPress(长按)。這些手势別在使用上也很简单,只要在使用前定义并添加到对应的视图上即可。// 定义一个 r 阅读全文
posted @ 2013-04-16 16:19 hopeanCom 阅读(229) 评论(0) 推荐(0)
摘要:#define kBgQueue dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT,0)- (void)viewDidLoad{ [superviewDidLoad]; dispatch_async(kBgQueue, ^{ NSData* data = [NSDatadataWithContentsOfURL:kLatestKivaLoansURL]; [selfperformSelectorOnMainThread:@selector(fetchedData:)withObject:datawaitUntilDo... 阅读全文
posted @ 2013-04-16 14:49 hopeanCom 阅读(245) 评论(0) 推荐(0)
摘要:UIButton *btn = [UIButtonbuttonWithType:UIButtonTypeCustom];1、[btn setTitle:@"测试一下" forState:UIControlStateNormal];输出:CurrentTitleLabel:测试一下,currentTitle:测试一下。模拟器button上显示:测试一下2、btn.titlelabel.text = @"测试一下";输出:CurrentTitleLabel:测试一下,currentTitle:(null)。模拟器button上无显示3、[btn setTit 阅读全文
posted @ 2013-04-16 10:25 hopeanCom 阅读(371) 评论(0) 推荐(0)
摘要:iPhoneAPI已经提供了系统写邮件界面的接口,使用MFMailComposeViewController,用来显示界面.项目中需要添加MessageUi.framework。头文件加入MFMailComposeViewControllerDelegate。#import<MessageUI/MessageUI.h>sendMailViewController.m文件的实现:-(void)viewDidLoad{UIButton*button=[UIButtonbuttonWithType:UIButtonTypeRoundedRect];button.frame=CGRectM 阅读全文
posted @ 2013-04-16 09:44 hopeanCom 阅读(353) 评论(0) 推荐(0)
摘要:-(BOOL)textField:(UITextField*)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString*)stringUITextField字符改变时调用,textField改变前的字符,range改变的范围,string改变的字符,如果确认改变返回YES,不改变返回NO 阅读全文
posted @ 2013-04-15 13:44 hopeanCom 阅读(628) 评论(0) 推荐(0)
摘要:[UITextField BecomeFirstResponder]启用键盘[UITextField ResignFirstResponder]关闭键盘UITextField.enablesReturnKeyAutomatically = YES当UITextField不为空时高亮。UITextField.keyboardType为键盘类型。UITextField.clearButtonMode:清空输入的字符,有以下几种模式 UITextFieldViewModeAlways,不为空,获得焦点与没有获得焦点都显示清空按钮 UITextFieldViewModeNever,不显示清空按钮 .. 阅读全文
posted @ 2013-04-15 13:43 hopeanCom 阅读(177) 评论(0) 推荐(0)
摘要:?1234publicSimpleExpandableListAdapter(Contextcontext,List<? extends Map<String, ?>> groupData, intgroupLayout,String[]groupFrom, int[] groupTo,List<?extendsList<? extendsMap<String, ?>>> childData, intchildLayout,String[]childFrom, int[] childTo)参数context 与SimpleExpand 阅读全文
posted @ 2012-12-12 14:24 hopeanCom 阅读(185) 评论(0) 推荐(0)
摘要:ExpandableListView / ExpandableListActivity[代码 步骤]1. 定义含有ExpandableListView 的布局:main.xml<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent& 阅读全文
posted @ 2012-12-12 13:48 hopeanCom 阅读(441) 评论(0) 推荐(0)
摘要:引用地址:http://blog.csdn.net/zkdemon/article/details/7446319核心动画,开发人员可以为他们的应用创建动态用户界面,而无需使用低级别的图形 API,如 OpenGL 来获取高效的动画性能。文章来源好岸园IT技术学习网:http://www.hopean.com前言,核心动画的好处1.简单易用的高性能混合编程模型。2.类似视图一样,你可以通过使用图层来创建复杂的接口。通过是CALayer来使用更复杂的一些动画。3.轻量级的数据结构,它可以同时显示并让上百个图层产生动画效果。控制多个CALayer来显示动画效果4.一套简单的动画接口,可以让你的动画 阅读全文
posted @ 2012-12-07 17:07 hopeanCom 阅读(222) 评论(0) 推荐(0)
摘要:iOS提供了拍击、旋转、滑动、挤捏等丰富的手势,因此对图像的操作就显得非常友好、简单。下面代码展示了使用UIGestureRecognizer对图像进行缩放、移动、旋转操作使用方法。在使用代码之前,首先建立一个UIView,并在该视图中增加一个UIImageView视图,用于展示图像。那么该UIView就类似图像画板一样,对图像的操作都基于此视图中进行。[代码] 在视图中创建手势识别器UIGestureRecognizers01 - (void)viewDidLoad {02 [super viewDidLoad];03 04 UIPinchGestureRecognizer *pinch.. 阅读全文
posted @ 2012-12-06 13:29 hopeanCom 阅读(302) 评论(0) 推荐(0)