- 博客(13)
- 资源 (1)
- 收藏
- 关注
原创 AVAudioPlayer音频播放
// ViewController.h@property (nonatomic)AVAudioPlayer *player;@property (weak, nonatomic) IBOutletUIButton *playButton;// ViewController.m- (IBAction)playButton:(
2014-11-25 23:40:59 473
原创 ios解档归档2
NSArray *array = [NSArrayarrayWithObjects:@"one",@"two", @"three",nil]; NSString *filePath = [NSHomeDirectory()stringByAppendingPathComponent:@"data"]; //多对象归档 NSMutableDa
2014-11-24 22:34:24 472
原创 iOS解档归档
NSArray *array = [NSArrayarrayWithObjects:@"one",@"two", @"three",nil]; NSString *filePath = [NSHomeDirectory()stringByAppendingPathComponent:@"arry.plist"]; [NSKeyedArchiverarch
2014-11-24 21:56:46 522
原创 NSCalendar获取两个年龄的相差天数
NSCalendar 类的- (NSDateComponents *)components:(NSUInteger)unitFlags fromDate:(NSDate *)startingDate toDate:(NSDate *)resultDate options:(NSUInteger)opts获取startDate与endDate 之间相隔几天NSCalendar *
2014-11-21 14:09:05 727
原创 block回调UIButton
// BlockBtn.h#import @interface BlockBtn :UIButton@property (nonatomic,copy)void(^block)(void);- (id)initWithFrame:(CGRect)frame;- (void)clickAction;@end
2014-11-18 01:52:18 575
原创 block引用局部变量
// AppDelegate.m- (int)test:(int (^)(int,int))block{ return block(10,20);}- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary
2014-11-18 00:32:29 558
原创 ios block 实现函数回调
//A.h#import @interface A : NSObject- (void)delegate:(int (^)(int,int))block;@end//A.
2014-11-17 23:32:39 568
原创 NSCalendar获取未来一年
NSDate *today = [[NSDatealloc] init]; NSCalendar *gregorian = [[NSCalendaralloc] initWithCalendarIdentifier:NSGregorianCalendar]; NSDateComponents *of
2014-11-17 20:09:19 495
原创 block实现函数回调
int test(int a)//函数{ printf("test function\n"); return a;}int testFuncPointer(int (*f) (int)){ printf("testFuncPointer fuction\n"); f(30); return 20;}int mai
2014-11-14 00:23:12 462
原创 函数指针实现函数回调
int test(int a)//函数{ printf("test function\n"); return a;}int testFuncPointer(int (*f) (int)){ printf("testFuncPointer fuction\n"); f(30); return 20;}int mai
2014-11-14 00:20:58 435
原创 iOS block 用法
int main(int argc,char * argv[]) { int (^b)(int);//block声明 b= ^(int a){//block创建 return a*a; }; printf("%d\n",b(10));//block调用}
2014-11-13 23:13:25 495
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人