02 2012 档案

摘要://加载本地pdf到webview-(void)loadDocument:(NSString*)documentName inView:(UIWebView*)webView{ NSString *path = [[NSBundle mainBundle] pathForResource:documentName ofType:nil]; NSURL *url = [NSURL fileURLWithPath:path]; NSURLRequest *request = [NSURLRequest requestWithURL:url]; [webView loadRequest:re... 阅读全文
posted @ 2012-02-29 17:10 凡娃软件 阅读(350) 评论(0) 推荐(0)
摘要://判断是ipad还是iphone-(BOOL)IsIPhone{ BOOL isPhone = NO; if(UI_USER_INTERFACE_IDIOM()) isPhone = (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone); return isPhone;} 阅读全文
posted @ 2012-02-29 13:55 凡娃软件 阅读(404) 评论(0) 推荐(0)
摘要://按钮事件-(IBAction)btnRead{ UIAlertView* a=[[UIAlertViewalloc]init]; a=[[UIAlertViewalloc] initWithTitle:@"b"message:@"s"delegate:selfcancelButtonTitle:@"确定"otherButtonTitles: @"取消",nil]; [a show];}//定义的委托,buttonindex就是按下的按钮的index值- (void)alertView:(UIAlertView 阅读全文
posted @ 2012-02-28 14:12 凡娃软件 阅读(1530) 评论(0) 推荐(0)
摘要:NSArray* arr=[@"asd;asdasd;dfd;gd;s;as;daf"componentsSeparatedByString:@";"]; for (int i=0; i<arr.count; i++) { NSString* str=[arr objectAtIndex:i]; NSLog(@"%@",str); } 阅读全文
posted @ 2012-02-28 10:26 凡娃软件 阅读(330) 评论(0) 推荐(0)
摘要:NSString * str=[[NSStringalloc]init]; str=@"1234567890"; NSRange r; r=[str rangeOfString:textview.text]; if (r.location!=NSNotFound) { NSLog(@"found at location = %d,length = %d",r.location,r.length); } else { NSLog(@"not found"); } 阅读全文
posted @ 2012-02-27 16:42 凡娃软件 阅读(314) 评论(0) 推荐(0)
摘要://获取文件路径 NSString *path = [[NSBundlemainBundle] pathForResource:@"user.plist"ofType:@""]; //获取数据 NSMutableDictionary* dict = [ [ NSMutableDictionaryalloc ] initWithContentsOfFile:path ]; NSString* object = [ dict objectForKey:@"aaa" ]; NSLog(object); //修改数据 NSMutableDic 阅读全文
posted @ 2012-02-27 14:56 凡娃软件 阅读(268) 评论(0) 推荐(0)
摘要://判断文件是否存在 if(![c judgeFileExist:@"user.plist"]) { NSLog(@"请确认该文件是否存在!"); return; }//判断文件是否存在-(BOOL)judgeFileExist:(NSString * )fileName{ //获取文件路径 NSString *path = [[NSBundle mainBundle] pathForResource:fileName ofType:@""]; if(path==NULL) return NO; returnYES;} 阅读全文
posted @ 2012-02-27 14:55 凡娃软件 阅读(637) 评论(0) 推荐(0)
摘要:xml字符串为:<users> <user name="hoge" age="20" /> <user name="fuga" age="30" /></users>//解析按钮事件-(IBAction)btnXml{ NSString* str= [uitextview1 text]; //string转成data NSData *xmlData = [str dataUsingEncoding: NSUTF8StringEncoding]; //对xml进行解析需 阅读全文
posted @ 2012-02-24 13:03 凡娃软件 阅读(1418) 评论(0) 推荐(0)
摘要:public static T CreateObject(string className){ var typeName=assemblyString+"."+className; var objType=(T)Assembly.Load(assemblyString).CreateInstance(typeName);} 阅读全文
posted @ 2012-02-24 09:31 凡娃软件 阅读(454) 评论(0) 推荐(0)
摘要:%@ Object%d, %i signed int%u unsigned int%f float/double%x, %X hexadecimal int%o octal int%zu size_t%p pointer%e float/double (in scientific notation)%g float/double (as %f or %e, depending on value)%s C string (bytes)%S C string (unichar)%.*s Pascal string (requires two arguments, pass pstr[0] as t 阅读全文
posted @ 2012-02-15 17:46 凡娃软件 阅读(459) 评论(0) 推荐(1)
摘要:str=[str stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]; 阅读全文
posted @ 2012-02-15 13:01 凡娃软件 阅读(784) 评论(0) 推荐(0)
摘要://asp.net中的web.config中,需要开启get方式或者post方式<system.web> <webServices> <protocols> <add name="HttpSoap"> <add name="HttpPost"> <add name="HttpGet"> <add name="Documentation"> </protocols> </webService></syst 阅读全文
posted @ 2012-02-15 10:23 凡娃软件 阅读(773) 评论(0) 推荐(0)
摘要:-(IBAction)addPicEvent{ UIImagePickerControllerSourceType sourceType=UIImagePickerControllerSourceTypeCamera; if (![UIImagePickerControllerisSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera]) { sourceType=UIImagePickerControllerSourceTypePhotoLibrary; } UIImagePickerController * pi... 阅读全文
posted @ 2012-02-15 10:05 凡娃软件 阅读(1440) 评论(1) 推荐(0)
摘要:先添加一个委托_webView.delegate=self;出现if (alertView==nil){ alertView = [[UIAlertViewalloc] initWithTitle:nil message: @"正在讀取網路資料" delegate: self cancelButtonTitle: nil otherButtonTitles: nil]; UIActivityIndicatorView *a... 阅读全文
posted @ 2012-02-14 17:36 凡娃软件 阅读(524) 评论(0) 推荐(0)
摘要:-(IBAction)btnStartClick{ proValue=0; timer = [NSTimerscheduledTimerWithTimeInterval:0.001target:selfselector:@selector(changeProgress) userInfo:nilrepeats:YES];}-(void)changeProgress{ proValue +=1.0; if(proValue > 1500) { //停用计时器 [timer invalidate]; } else { [proView setProgres... 阅读全文
posted @ 2012-02-14 14:44 凡娃软件 阅读(656) 评论(0) 推荐(0)
摘要:thOne=[[NSThreadalloc]initWithTarget:selfselector:@selector(run) object:nil];[thOne start];-(void)run{ //代码} 阅读全文
posted @ 2012-02-14 14:14 凡娃软件 阅读(591) 评论(0) 推荐(0)
摘要:模拟器有这个问题,真机不会,经试验是TextField的Correction属性引起的,把这个属性设为NO就好了 阅读全文
posted @ 2012-02-14 12:00 凡娃软件 阅读(445) 评论(0) 推荐(1)
摘要:挡住的处理事件地址在:http://www.cnblogs.com/fanwa/archive/2012/02/14/2350667.html以下是还原的处理事件:注册监听事件:[[NSNotificationCenterdefaultCenter] addObserver:selfselector:@selector(keyboardWillBeHidden:) name:UIKeyboardWillHideNotificationobject:nil];事件代码:- (void)keyboardWillBeHidden:(NSNotification*)aNotification { .. 阅读全文
posted @ 2012-02-14 11:32 凡娃软件 阅读(419) 评论(0) 推荐(0)
摘要:新的方式:- (IBAction)textFieldDidBeginEditing:(UITextField *)textField { activeText = textField; [self slideFrame:YES];}- (IBAction)textFieldDidEndEditing:(UITextField *)textField { activeText = nil; [self slideFrame:NO];}-(void) slideFrame:(BOOL) up{ int movementDistance = 0; // twea... 阅读全文
posted @ 2012-02-14 11:22 凡娃软件 阅读(1481) 评论(3) 推荐(0)
摘要:txtUser.borderStyle=UITextBorderStyleRoundedRect; 阅读全文
posted @ 2012-02-13 18:38 凡娃软件 阅读(854) 评论(0) 推荐(0)
摘要:UIWebView* web=[[UIWebViewalloc]initWithFrame:CGRectMake(0,0,320,460)];NSURL*url =[NSURLURLWithString:@"http://www.fanwa.net"]; NSURLRequest*request =[NSURLRequestrequestWithURL:url]; [webloadRequest:request];[self.viewaddSubview:web]; 阅读全文
posted @ 2012-02-13 17:46 凡娃软件 阅读(340) 评论(0) 推荐(0)
摘要://添加uinav上的按钮UIBarButtonItem* rbutton=[[UIBarButtonItemalloc] initWithTitle:@"登录"style:UIBarButtonItemStyleDonetarget:selfaction:@selector(btnLogin)];self.navigationItem.rightBarButtonItem=rbutton;UIBarButtonItem* lbutton=[[UIBarButtonItemalloc] initWithTitle:@"退出"style:UIBarButt 阅读全文
posted @ 2012-02-13 17:43 凡娃软件 阅读(364) 评论(0) 推荐(0)
摘要:1.在AppDelegate.m实现的事件代码,用UINavigationController来进行页面之间的切换- (BOOL)application:(UIApplication*)application didFinishLaunchingWithOptions:(NSDictionary*)launchOptions{ self.window=[[UIWindowalloc]initWithFrame:[[UIScreenmainScreen]bounds]]; self.window.backgroundColor=[UIColorwhiteColor]; rootView* r=[ 阅读全文
posted @ 2012-02-13 17:28 凡娃软件 阅读(638) 评论(0) 推荐(0)