摘要:原帖地址:http://www.devdiv.com/thread-69786-1-1.htmlUILocalNotification实现本地的闹钟提醒的方法UILocalNotification *notification=[[UILocalNotification alloc] init]; if (notification!=nil) { NSDate *now=[NSDate new]; //notification.fireDate=[now addTimeInterval:period]; notification.fireDate = [now...
阅读全文
摘要:原帖地址:http://www.devdiv.com/forum.php?mod=viewthread&tid=29002&extra=page%3D1%26filter%3Dtypeid%26typeid%3D34%26typeid%3D34如何结束一个NSThread线程本人在主线程中通过NSThread *newThread = [[NSThread initWithTarget:self selector:@selector(MyThread:) object:timer]; 开始一个新线程当满足条件时欲调用[newThread cancel]退出此线程,但发现线程并未
阅读全文
摘要:原帖地址:http://www.devdiv.com/forum.php?mod=viewthread&tid=42805&extra=page%3D1%26filter%3Ddigest%26digest%3D1%26digest%3D1/******************************************************************************************* NSArray ***********************************************************************
阅读全文
摘要:原帖地址:http://www.devdiv.com/forum.php?mod=viewthread&tid=31996&extra=page%3D1%26filter%3Ddigest%26digest%3D1%26digest%3D1NSArray *newArray =[[NSArray alloc] addObjectsFromArray:oldArray];array最简单的创建应该就是[NSArray arrayWithObject:@"aaaaa",@"bbbb",nil];1. 先看看什么是深拷贝,什么是浅拷贝:比如有这
阅读全文
摘要:原帖地址:http://www.devdiv.com/forum.php?mod=viewthread&tid=42809&extra=page%3D1%26filter%3Ddigest%26digest%3D1%26digest%3D11. 创建一个线程view plaincopy to clipboardprint?[NSThread detachNewThreadSelect:@selector(BeginThread) toTarget:selft withObject:nil]; [NSThread detachNewThreadSelect:@selector(B
阅读全文
摘要:原帖地址:http://www.devdiv.com/forum.php?mod=viewthread&tid=104289&extra=page%3D1%26filter%3Ddigest%26digest%3D1%26digest%3D1通过Luhn算法校验的过程:1、从卡号最后一位数字开始,逆向将奇数位(1、3、5等等)相加。2、从卡号最后一位数字开始,逆向将偶数位数字,先乘以2(如果乘积为两位数,则将其减去9),再求和。3、将奇数位总和加上偶数位总和,结果应该可以被10整除。例如,卡号是:5432123456788881则奇数、偶数位(用红色标出)分布:54321234
阅读全文