摘要: //// 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 13:39 言程序 阅读(159) 评论(0) 推荐(0)
摘要: //// MyImageViewController.m// MyImageView//// Created by lanou on 12-12-19.// Copyright (c) 2012年 lanou. All rights reserved.//#import "MyImageViewController.h"@interfaceMyImageViewController ()@end@implementation MyImageViewController- (id)initWithNibName:(NSString *)nibNameOrNil bundle: 阅读全文
posted @ 2012-12-20 09:35 言程序 阅读(279) 评论(0) 推荐(0)
摘要: //// ImageViewController.m// TestImageView//// Created by lanou on 12-12-19.// Copyright (c) 2012年 lanou. All rights reserved.//#import "ImageViewController.h"@interfaceImageViewController ()@end@implementation ImageViewController-(void)dealloc{ [_imageViewrelease]; [super dealloc];}- (id) 阅读全文
posted @ 2012-12-19 19:59 言程序 阅读(1228) 评论(0) 推荐(0)
摘要: //// DoodleViewController.m// UI4practice//// Created by lanou on 12-12-17.// Copyright (c) 2012年 lanou. All rights reserved.//#import "DoodleViewController.h"#import "Doodleview.h"@interfaceDoodleViewController ()@end@implementation DoodleViewController- (id)initWithNibName:(NSS 阅读全文
posted @ 2012-12-19 19:56 言程序 阅读(296) 评论(0) 推荐(0)
摘要: atomic和nonatomic用来决定编译器生成的getter和setter是否为原子操作。atomic设置成员变量的@property属性时,默认为atomic,提供多线程安全。在多线程环境下,原子操作是必要的,否则有可能引起错误的结果。加了atomic,setter函数会变成下面这样:{lock}if (property != newValue) {[property release];property = [newValue retain];}{unlock}nonatomic禁止多线程,变量保护,提高性能。atomic是Objc使用的一种线程保护技术,基本上来讲,是防止在写未完成的时 阅读全文
posted @ 2012-12-16 16:58 言程序 阅读(179) 评论(0) 推荐(0)
摘要: :NSTimer的使用方法[NSTimerscheduledTimerWithTimeInterval:0.2target:selfselector:@selector(changeColor)userInfo:nilrepeats:YES];//让NSTimer消失的方法[_timer invalidate];:AVAudioPlayer的简单使用 //创建音乐文件路径NSString* musicFilePath = [[NSBundlemainBundle]pathForResource:@"jnstyle"ofType:@"mp3"];//根据路 阅读全文
posted @ 2012-12-16 16:44 言程序 阅读(208) 评论(0) 推荐(0)
摘要: UISlider的简单使用(可拖动进度条) self.slider= [[UISlideralloc]initWithFrame:CGRectMake(0, 520, 320, 10)];self.slider.minimumValue= 0;//设置可变最小值self.slider.maximumValue= 2;//设置可变最大值self.slider.value= 5; [self.slideraddTarget:selfaction:@selector(changeValue)forControlEvents:UIControlEventValueChanged]; [self.vi. 阅读全文
posted @ 2012-12-16 16:44 言程序 阅读(2884) 评论(0) 推荐(0)
摘要: //设置button文字阴影颜色在高亮状态显示 [buttonsetTitleShadowColor:[UIColorblueColor]forState:UIControlStateHighlighted];//为button文字设置阴影位置 [button.titleLabelsetShadowOffset:CGSizeMake(3, 3)];//为button文字设置字体大小 button.titleLabel.font= [UIFontsystemFontOfSize:23]; 阅读全文
posted @ 2012-12-16 16:41 言程序 阅读(509) 评论(0) 推荐(0)
摘要: -(void)touchesEnded:(NSSet*)touches withEvent:(UIEvent*)event{if(![self.txtField isExclusiveTouch]) { [self.txtField resignFirstResponder]; }} 阅读全文
posted @ 2012-12-16 16:40 言程序 阅读(460) 评论(0) 推荐(0)
摘要: //创建imageViewself.imageView= [[UIImageViewalloc]initWithFrame:CGRectMake(0, 40, 320, 260)];//把图片添加到动态数组NSMutableArray* animateArray = [[NSMutableArrayalloc]initWithCapacity:20]; [animateArrayaddObject:[UIImageimageNamed:@"t1.png"]]; [animateArrayaddObject:[UIImageimageNamed:@"t2.png&q 阅读全文
posted @ 2012-12-16 16:33 言程序 阅读(2458) 评论(0) 推荐(0)