自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(26)
  • 资源 (1)
  • 收藏
  • 关注

原创 Swift的Debug和Release宏

step a:在Swift Compiler - Custom Flags的Other Swift Flags的Debug里添加-DDEBUG在Release里添加-DRELEASEstep b:        在代码里这么使用        #if DEBUG            print("debug")        #endif 

2016-02-15 17:20:00 3308

原创 UIView的动画事务

UIView.beginAnimations("1", context:nil)        UIView.setAnimationDuration(moveDuration)        UIView.setAnimationRepeatCount(MAXFLOAT)        UIView.setAnimationRepeatAutoreverses(tru

2015-12-30 17:23:27 541

原创 NSCondition

@UIApplicationMainclass AppDelegate:UIResponder, UIApplicationDelegate {    var window: UIWindow?    var product = [String]()    let condition = NSCondition()    

2015-12-18 15:10:37 579

原创 Swift开源

Swift于2015年12月4号开源,欣喜之情难以表达,无奈编译器这种东西感兴趣还是小众,也没人能分享我的喜悦,故在此记录一笔,该语言的优秀性只有懂的人才懂。开源地址https://github.com/apple和https://swift.org 支持Linux平台

2015-12-04 11:02:13 381

原创 iOS后台运行

Apple的原版见https://developer.apple.com/library/ios/documentation/iPhone/Conceptual/iPhoneOSProgrammingGuide/iPhoneAppProgrammingGuide.pdf根据实验,可以实现后台3分钟时间或一直后台运行// 三分钟版本先在Info.plist里添加Required

2015-11-30 20:56:20 571

原创 iOS网络(Swift)

////  NetworkStatus.swift////  Created by A on 15/10/26.//  Copyright © 2015年 A. All rights reserved.//import Foundationimport CoreTelephony.CTTelephonyNetworkInfo

2015-11-17 20:59:54 1769 1

原创 iOS设备类型(Swift)

////  DeviceInfo.swift//  AWiFi////  Created by A on 15/10/12.//  Copyright © 2015年 A. All rights reserved.//import Foundationimport SystemConfiguration.CaptiveNe

2015-11-17 20:56:59 826

原创 监测iOS截屏(Swift)

////  ScreenshotManager.swift//  ImagePicker////  Created by 成杰 on 15/11/17.//  Copyright © 2015年成杰. All rights reserved.//import UIKitimport Foundationimpo

2015-11-17 20:55:03 948

原创 Swift 自己写定时器

private var timer:dispatch_source_t? = nil    private func startTimer() {        let updateInterval: UInt64 = 1        let interval = updateInterval * NSEC_PER_SEC        let l

2015-11-17 19:01:07 945

原创 AutoLayout Swift demo

import UIKitimport Swiftclass ViewController:UIViewController {   override func viewDidLoad() {       super.viewDidLoad()       let v1 = UIView()       let v2 =

2015-06-30 15:16:57 426

原创 iOS动画

//动画    CATransition *transition = [CATransitionanimation];    transition.duration =6.0;    transition.type =kCATransitionMoveIn;    transition.subtype =kCATransitionFromBottom;

2014-12-17 17:00:59 469

原创 C++ find accumulate count的用法

#include #include #include #include #include using namespace std;int main(){ vector vint = {1,2,3,4,5,6,7,8}; auto result = find(vint.cbegin(),vint.cend(),40); cout  int ia[] =

2014-12-02 20:23:05 646

原创 AVAudioPlayer音频播放

//  ViewController.h@property (nonatomic)AVAudioPlayer *player;@property (weak, nonatomic) IBOutletUIButton *playButton;//  ViewController.m- (IBAction)playButton:(

2014-11-25 23:40:59 437

原创 ios解档归档2

NSArray *array = [NSArrayarrayWithObjects:@"one",@"two", @"three",nil];    NSString *filePath = [NSHomeDirectory()stringByAppendingPathComponent:@"data"];    //多对象归档    NSMutableDa

2014-11-24 22:34:24 462

原创 iOS解档归档

NSArray *array = [NSArrayarrayWithObjects:@"one",@"two", @"three",nil];    NSString *filePath = [NSHomeDirectory()stringByAppendingPathComponent:@"arry.plist"];    [NSKeyedArchiverarch

2014-11-24 21:56:46 507

原创 ios获取网络图片

//  ViewController.m

2014-11-22 21:47:18 436

原创 NSCalendar获取两个年龄的相差天数

NSCalendar 类的- (NSDateComponents *)components:(NSUInteger)unitFlags fromDate:(NSDate *)startingDate toDate:(NSDate *)resultDate options:(NSUInteger)opts获取startDate与endDate 之间相隔几天NSCalendar *

2014-11-21 14:09:05 713

原创 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 562

原创 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 548

原创 函数指针实现对象传递消息(回调)

//  AppDelegate.m

2014-11-17 23:55:36 416

原创 ios block 实现函数回调

//A.h#import @interface A : NSObject- (void)delegate:(int (^)(int,int))block;@end//A.

2014-11-17 23:32:39 555

原创 NSCalendar获取未来一年

NSDate *today = [[NSDatealloc] init];    NSCalendar *gregorian = [[NSCalendaralloc]                             initWithCalendarIdentifier:NSGregorianCalendar];    NSDateComponents *of

2014-11-17 20:09:19 487

原创 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 451

原创 函数指针实现函数回调

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 425

原创 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 483

原创 windbg win7 本地调试

1:以管理员身份运行cmd,输入bcdedit -

2014-10-05 21:59:09 652

Microsoft.Press.Programming.Windows.6th.Edition.Jan.2013

windows 程序设计第六版(英文版)全

2014-10-01

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除