12 2012 档案

摘要://// 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 言程序 阅读(361) 评论(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 言程序 阅读(634) 评论(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 13:39 言程序 阅读(162) 评论(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 言程序 阅读(281) 评论(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 言程序 阅读(300) 评论(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 言程序 阅读(180) 评论(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 言程序 阅读(211) 评论(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 言程序 阅读(2886) 评论(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 言程序 阅读(510) 评论(0) 推荐(0)
摘要:-(void)touchesEnded:(NSSet*)touches withEvent:(UIEvent*)event{if(![self.txtField isExclusiveTouch]) { [self.txtField resignFirstResponder]; }} 阅读全文
posted @ 2012-12-16 16:40 言程序 阅读(464) 评论(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 言程序 阅读(2462) 评论(0) 推荐(0)
摘要:1:输入一个字节的数(小于256)与移位个数,输出移位的结果(一个字节循环移位) unsigned char a=0,b=0; int n=0,x = 0,y = 0,c=0,d=0; scanf("%d,%d",&x,&y); a = (char)x; n = (char)y; c=a>>n; d=a<<(8-n); b=c|d; printf("%d",b);思路:把输入的int型的数字转换成char型的,因为根据要求一个字节char符合要求。 根据题意循环移位即例:右移出的数字要在左边循环回来,即只需看移出的 阅读全文
posted @ 2012-12-08 13:51 言程序 阅读(500) 评论(0) 推荐(0)