08 2012 档案

摘要:主要操作: 1.//获得plist路径 -(NSString*)getPlistPath; 2.//判断沙盒中名为plistname的文件是否存在 -(BOOL) isPlistFileExists; 3.//读取沙盒中Document文件夹下的BookList.plist文件 [NSMutable 阅读全文
posted @ 2012-08-26 19:53 小、 阅读(9675) 评论(1) 推荐(1)
摘要:NSTimer其实是将一个监听加入到系统的RunLoop中去,当系统runloop到如何timer条件的循环时,会调用timer一次,当timer执行完,也就是回调函数执行之后,timer会再一次的将自己加入到runloop中去继续监听。 CFRunLoopTimerRef 和 NSTimer这两个 阅读全文
posted @ 2012-08-24 21:24 小、 阅读(41380) 评论(6) 推荐(1)
摘要:// 以release模式编译的程序不会用NSLog输出,而以debug模式编译的程序将执行NSLog的全部功能。 #ifndef __OPTIMIZE__# define NSLog(...) NSLog(__VA_ARGS__)#else# define NSLog(...)#endif 或 # 阅读全文
posted @ 2012-08-24 14:06 小、 阅读(4125) 评论(0) 推荐(0)
摘要://先定义一个变量值BOOL isProgressShow;-(void)buttonClicked{ if (isProgressShow) { [activityIndicatorView stopAnimating]; }else{ [activityIndicatorView startAnimating]; } isProgressShow = !isProgressShow;}- (void)viewDidLoad{ [super viewDidLoad]; UIView *contentView = [[UI... 阅读全文
posted @ 2012-08-24 13:59 小、 阅读(431) 评论(0) 推荐(0)
摘要:新浪微博: ios小项目——新浪微博客户端总结 http://blog.csdn.net/kay_sprint/article/details/7481129 非沙盒的plist文件操作和分组UITableView: http://blog.csdn.net/holydancer/article/d 阅读全文
posted @ 2012-08-22 21:52 小、 阅读(227) 评论(0) 推荐(0)
摘要://初始化AlertViewUIAlertView *alert = [[UIAlertView alloc]initWithTitle:@"AlertViewTest" message:@"message" delegate:self cancelButtonTitle:@"Cancel" otherButtonTitles:@"OtherBtn",nil]; //... 阅读全文
posted @ 2012-08-21 19:34 小、 阅读(280) 评论(0) 推荐(0)
摘要:1.。效果图:分别为有短信分享 无短信分享-(void)viewDidLoad{ //添加按钮 UIButton *shareButton = [[UIButton alloc] initWithFrame:CGRectMake(100, 100, 100, 50)]; [shareButton setBackgroundColor:[UIColor redColor]]; [shareButton addTarget:self action:@selector(shareButtonPressed) forControlEvents... 阅读全文
posted @ 2012-08-21 18:32 小、 阅读(2971) 评论(1) 推荐(0)
摘要://高度可调且有一个显示更多的按钮-(void)viewDidLoad{ UITableView* table=[[UITableView alloc]initWithFrame:CGRectMake(0, 44, 320, 416)]; table.delegate=self; table.dat 阅读全文
posted @ 2012-08-20 17:04 小、 阅读(388) 评论(0) 推荐(0)
摘要:1.点击按钮触发allcountry事件:-(void)allcoutry{ //界面设计 picker_background=[[UIView alloc] initWithFrame:CGRectMake(0, 0, 320, 480)]; UIImageView *navigationItem=[[UIImageView alloc] initWithImage:[UIImage imageNamed:@"SchoolSearch_AllPleace_navBar.png"]]; navigationItem.frame=CGRectMake(0, 0, 320,.. 阅读全文
posted @ 2012-08-20 16:25 小、 阅读(4111) 评论(0) 推荐(0)
摘要:非正式协议(interface),但其实质仍是调用正式协议(protocal) 正式协议(protocal)可以将业务中的方法定义剥离出来,形成一个单独的文件,这跟传统OO中的提取接口是不谋而合的。如果遇到二个系统需要交换数据,可以制定一套双方都遵守的protocal,然后这二个系统中都把这个协议文 阅读全文
posted @ 2012-08-20 13:19 小、 阅读(6409) 评论(0) 推荐(1)
摘要:shoxuian 阅读全文
posted @ 2012-08-20 10:09 小、 阅读(687) 评论(0) 推荐(0)
摘要:拨打电话, 按钮触发toCall事件: // NSString *phone_temp_call=[phone_tempstringByReplacingOccurrencesOfString:@"-"withString:@""]; // NSLog(@"phone_temp_call is %@ 阅读全文
posted @ 2012-08-20 09:58 小、 阅读(257) 评论(0) 推荐(0)
摘要:新建一个继承NSObject的类ICMemoryHelper,.m文件的代码如下所示: 调用的时候只要:[ICMemoryHelper OutputMemory];就可以了 阅读全文
posted @ 2012-08-20 09:36 小、 阅读(1047) 评论(0) 推荐(0)
摘要:NSLog可以如下面的方法使用: NSLog (@"this is a test"); NSLog (@"string is :%@", string); NSLog (@"x=%d, y=%d", 10, 20); 但是下面的写法是不行的: int i = 12345; NSLog( @"%@", 阅读全文
posted @ 2012-08-20 09:23 小、 阅读(1222) 评论(0) 推荐(0)
摘要:- (void)viewDidLoad{ [super viewDidLoad]; // Do any additional setup after loading the view, typically from a nib. /*********按钮控件UIButton**********/ UIButton *myButton = [UIButtonbuttonWithType:UIButtonTypeRoundedRect]; //按钮风格,6种 myButton.frame = CGRectMake(25.0, 25.0, 100.0, 100... 阅读全文
posted @ 2012-08-19 16:44 小、 阅读(474) 评论(0) 推荐(0)
摘要://UISlider触发的动作-(void)sliderValueChanged:(id)sender{ UISlider *control = (UISlider *)sender; if (control == mySlider) { float value = control.value; /*添加代码,对滑块的值做出响应*/ } }-(void)viewDidLoad{ /***********滑块控件UISlider**************/ //创建控件 UISl... 阅读全文
posted @ 2012-08-19 16:42 小、 阅读(330) 评论(0) 推荐(0)
摘要://UISwitch触发的动作-(void)switchStatusChanged:(id)sender{ UISwitch *control = (UISwitch *)sender; if (control == mySwitch) { BOOL ison = control.on; /*添加代码,处理开关的状态*/ }}-(void)viewDidLoad{ /*************开关控件UISwitch**************/ //创建控件 UISwitch *aSwitch = [UISwitch alloc... 阅读全文
posted @ 2012-08-19 16:39 小、 阅读(513) 评论(0) 推荐(0)
摘要:-(void) viewDidLoad{ /*************分段控件UISegmentdControl*************/ UISegmentedControl *segmentedControl = [[UISegmentedControlalloc] initWithItems:nil]; segmentedControl.segmentedControlStyle = UISegmentedControlStyleBar; //控件风格小按钮,适合导航栏: segmentedControl.segmentedControlStyle = UISegme... 阅读全文
posted @ 2012-08-19 16:28 小、 阅读(7315) 评论(0) 推荐(0)
摘要:转载于爱德凡的百度空间,地址:http://hi.baidu.com/aidfan/item/34a720866b33cbcdef083d37 UIWebView 使用详解 转载于爱德凡的百度空间,地址:http://hi.baidu.com/aidfan/item/34a720866b33cbcd 阅读全文
posted @ 2012-08-19 15:42 小、 阅读(7377) 评论(2) 推荐(1)
摘要://先来一个可行的小Demo程序:结合searchBar的google搜索 //2.用webview显示内容,高度自适应 阅读全文
posted @ 2012-08-19 15:42 小、 阅读(17309) 评论(0) 推荐(0)
摘要:本文部分转自俺是一个瓜娃!!!的博客UISwipeGestureRecognizer 手指动作,转载过来仅是为了自己查询方便。 tap是指轻触手势。类似鼠标操作的点击。从iOS 3.2版本开始支持完善的手势api: tap:轻触 long press:在一点上长按 pinch:两个指头捏或者放的操作 阅读全文
posted @ 2012-08-07 21:41 小、 阅读(34074) 评论(0) 推荐(1)
摘要:以下部分转自angellixf的博客: Objective-c NSDate 取时间,日期,星期,毫秒等,感觉很不错,没改动直接上代码了 阅读全文
posted @ 2012-08-07 21:33 小、 阅读(1616) 评论(1) 推荐(0)
摘要:UITextView协议: //点击开始编辑:- (BOOL)textViewShouldBeginEditing:(UITextView *)textView;- (void)textViewDidBeginEditing:(UITextView *)textView; //结束编辑 - (BOO 阅读全文
posted @ 2012-08-07 16:26 小、 阅读(2851) 评论(3) 推荐(0)
摘要://.h文件@interface ViewController : UIViewController<UIScrollViewDelegate>{ UIScrollView *scrollView; UIImageView *imageView; }//.m文件- (void)viewDidLoad{ [super viewDidLoad]; // Do any additional setup after loading the view, typically from a nib. // CGRect *screenBounds = [[UIScr... 阅读全文
posted @ 2012-08-07 16:25 小、 阅读(4211) 评论(0) 推荐(0)
摘要:基类控件UIControl、分段控件UISegmentControl、开关控间UISwitch、滑块控件UISlider、按钮控件UIButton -(void) viewDidLoad{ //属性 enabled //默认启用 selected //选中空间是其属性置为YES contentVer 阅读全文
posted @ 2012-08-04 14:38 小、 阅读(789) 评论(0) 推荐(0)