摘要: 两种动画:1:UIView动画UIView的部分属性支持动画:frame, bounds(中心点不变,放大或缩小), center, transform, alpha[UIView beginAnimation: context:];[UIView setAnimationTransition:UIVIewAnimationTransitionFlikpFromLeft forView:self.view ]layersetClipsToBounds把超出部分切掉[UIView commitAnimation];UIView支持翻转以及翻页效果UIView setAnimationWillS. 阅读全文
posted @ 2013-02-21 11:01 言程序 阅读(2278) 评论(1) 推荐(1)
摘要: 通知 KVO(Key-Value Observing)NSString*value = [NSStringstringWithFormat:@"%d",(int)_mySlider.value];NSLog(@"%@",[selfvalueForKeyPath:@"myTxt.text"]);NSString*keyPath =@"myTxts.text";[selfsetValue:valueforKeyPath:keyPath];KVC(Key-Value Coding)===========1://加一个检测 阅读全文
posted @ 2013-02-21 10:59 言程序 阅读(199) 评论(0) 推荐(0)
摘要: 主类.h #import <UIKit/UIKit.h> #import <MessageUI/MessageUI.h> @interface MyViewController : UIViewController <UIImagePickerControllerDelegate,UINavigat 阅读全文
posted @ 2013-02-21 10:40 言程序 阅读(217) 评论(0) 推荐(0)
摘要: assign: 简单赋值,不更改索引计数copy: 建立一个索引计数为1的对象,然后释放旧对象retain:释放旧的对象,将旧对象的值赋予输入对象,再提高输入对象的索引计数为1Copy其实是建立了一个相同的对象,而retain不是:比如一个NSString对象,地址为0×1111,内容为@”STR”Copy到另外一个NSString之 后,地址为0×2222,内容相同,新的对象retain为1, 旧有对象没有变化retain到另外一个NSString之 后,地址相同(建立一个指针,指针拷贝),内容当然相同,这个对象的retain值+1也就是说,retain是指针拷贝,cop 阅读全文
posted @ 2013-02-19 09:34 言程序 阅读(241) 评论(0) 推荐(0)
摘要: ----------------------- Page 1----------------------- Daniel's Objective-C Coding Style Guidelines From: 杨德升 /http://desheng.me/desheng.young@gmail.com Date: 2010.10.31 参考资料: • Apple:Coding Guidelines for Cocoa • Google:Objective-C Style Guide • Three20:Source code style guildelines 正文: • 格式化代码 阅读全文
posted @ 2013-02-17 09:06 言程序 阅读(261) 评论(0) 推荐(0)
摘要: .h#import <UIKit/UIKit.h>#import <CoreLocation/CoreLocation.h>#import <MapKit/MapKit.h>@interface SecondViewController : UIViewController<CLLocationManagerDelegate,MKMapViewDelegate,NSURLConnectionDataDelegate,NSURLConnectionDelegate>{ IBOutlet UIView *mapBottomView; IBOutlet 阅读全文
posted @ 2013-01-31 20:40 言程序 阅读(8444) 评论(1) 推荐(1)
摘要: 1:相机&从相册中获取图片.h记得导入<UIImagePickerControllerDelegate,UINavigationControllerDelegate,MFMailComposeViewControllerDelegate>.m://// ViewController.m// LessonHardWare//// Created by cyy on 13-1-29.// Copyright (c) 2013年 LanOuKeJi. All rights reserved.//#import "ViewController.h"@interf 阅读全文
posted @ 2013-01-30 20:31 言程序 阅读(799) 评论(0) 推荐(0)
摘要: set方法:-(void)setName:(NSString *)name{ if (_name != name) { [_name release]; [name retain]; _name = name; }}凡是.h里面的带星号变量或者属性的都要在dealloc中release一下 [_name release];这样释放 或者self.xxx = nil;这种更好get方法:-(UILabel *)titleLable{ if (_titleLable == nil) { _titleLable = [[UILabelalloc]init]; ... 阅读全文
posted @ 2013-01-09 13:32 言程序 阅读(17563) 评论(0) 推荐(0)
摘要: //// MyViewController.m// ReadWrite//// Created by lanou on 12-12-30.// Copyright (c) 2012年 lanou. All rights reserved.//#import "MyViewController.h"@interfaceMyViewController ()@end@implementation MyViewController- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleO 阅读全文
posted @ 2012-12-30 13:48 言程序 阅读(356) 评论(0) 推荐(0)
摘要: //// ScrollViewController.m// MyScrollView//// Created by lanou on 12-12-20.// Copyright (c) 2012年 lanou. All rights reserved.//#import "ScrollViewController.h"@interfaceScrollViewController ()@end@implementation ScrollViewController- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NS 阅读全文
posted @ 2012-12-20 20:28 言程序 阅读(631) 评论(0) 推荐(0)