06 2012 档案

摘要:str = [strstringByReplacingOccurrencesOfString:@"\n"withString:@""];str = [strstringByReplacingOccurrencesOfString:@"\r"withString:@""]; 阅读全文
posted @ 2012-06-19 17:55 高笑228 阅读(217) 评论(0) 推荐(0)
摘要:你可曾遇到过viewWillAppear没有被调用到的情况产生原因是用了UINavigationController.将UINavigationController的view作为subview添加到了其他viewController的view中。或者把UINavigationController添加到UITabbarController中了。此时,NavigationController的stack里面的viewController就收不到-(void)viewWillAppear:(BOOL)animated;等4个方法的调用。 原因呢 Apple Docs state:Warning: I 阅读全文
posted @ 2012-06-18 14:10 高笑228 阅读(1472) 评论(0) 推荐(0)
摘要:在头文件中引入framework加入#import <MessageUI/MessageUI.h> 到InAppEmailViewController.h显示 MFMailComposeViewController UIMFMailComposeViewController与其他view controller一样; 我们可以在InAppEmailViewController 使用presentModalViewController使其滑入屏幕。替换InAppEmailController.m中的buttonPressed方法:1234567- (IBAction)buttonPre 阅读全文
posted @ 2012-06-18 12:09 高笑228 阅读(206) 评论(0) 推荐(0)
摘要:- (void)onClick:(id)sender{ UIButton *helpImageBtn = (UIButton *)sender; [UIView animateWithDuration:1.25f animati*****:^{ // fade out helpImageBtn.alpha = 0.0f; } completion:^(BOOL fini... 阅读全文
posted @ 2012-06-18 11:47 高笑228 阅读(201) 评论(0) 推荐(0)
摘要:NSBundle *bundle = [NSBundle mainBundle]; NSURL *plistURL = [bundle URLForResource:@"provinceCities" withExtension:@"plist"]; NSLog(@"%@", plistURL); self.dictionary = [NSDictionary dictionaryWithContentsOfURL:plistURL]; NSArray *components = [dictionary allKeys]; NSArr 阅读全文
posted @ 2012-06-14 00:43 高笑228 阅读(184) 评论(0) 推荐(0)
摘要:-(void)scrollViewDidEndDragging:(UIScrollView *)scrollView willDecelerate:(BOOL)decelerate{ if (scrollView.contentOffset.y < -80) { [UIView beginAnimations:nil context:nil]; [UIView setAnimationDuration:0.3]; [scrollView setContentInset:UIEdgeInsetsMake(80, 0, 0, 0)];// [scrollView setContentInse 阅读全文
posted @ 2012-06-13 23:31 高笑228 阅读(1423) 评论(0) 推荐(0)
摘要:在Iphone上有两种读取图片数据的简单方法: UIImageJPEGRepresentation和UIImagePNGRepresentation. UIImageJPEGRepresentation函数需要两个参数:图片的引用和压缩系数.而UIImagePNGRepresentation只需要图片引用作为参数.通过在实际使用过程中,比较发现: UIImagePNGRepresentation(UIImage* image) 要比UIImageJPEGRepresentation(UIImage* image, 1.0) 返回的图片数据量大很多.譬如,同样是读取摄像头拍摄的同样景色的照片, 阅读全文
posted @ 2012-06-05 15:56 高笑228 阅读(305) 评论(0) 推荐(0)
摘要:iPhone开发之消息通信机制NSNotificationCenter是本文要介绍的内容,主要是来学习消息通信机制NSNotificationCenter的学习。最近写程序需要用到这类,研究了下,现把成果和大家分享。NSNotificationCenter是专门供程序中不同类间的消息通信而设置的,使用起来极为方便,长话短说。设置通知,就是说要在什么地方(哪个类)接受通知,一般在初始化中做。[[NSNotificationCenterdefaultCenter]addObserver:selfselector:@selector(test:)name:@"test"objec 阅读全文
posted @ 2012-06-05 15:02 高笑228 阅读(226) 评论(0) 推荐(0)
摘要:1,使用presentModalViewController可创建模式对话框,可用于视图之间的切换。如何关闭presentModalViewController弹出来得时模式窗口presentModalViewController弹出来得时模式窗口如果[A presentModalViewController:B animated:YES];那么触发关闭事件的一般是在 B里面。除非使用后台线程计时器关闭(不实用)B 里面可以 通过 [self dismissModalViewControllerAnimated:YES]; 实现还可以通过发 消息给A,通知A关闭B还可以通过委托实现 阅读全文
posted @ 2012-06-04 11:39 高笑228 阅读(264) 评论(0) 推荐(0)
摘要:[self performSelector:@selector(testLog:andString2:andString3:) withObject:@"aaa" withObject:@"bbbb" withObject:@"ccccc"]; 阅读全文
posted @ 2012-06-03 01:26 高笑228 阅读(252) 评论(0) 推荐(0)