ios本地推送方法 第一步:创建本地推送  // 创建一个本地推送 UILocalNotification *notification = [[[UILocalNotification alloc] init] autorelease]; ……继续阅读 » 水墨上仙 5年前 (2021-03-14) 2692浏览 2993个赞
objective c去掉列表的分割行(Line Separator)[tableView setSeparatorStyle:UITableViewCellSeparatorStyleNone];……继续阅读 » 水墨上仙 5年前 (2021-03-14) 2904浏览 2386个赞
objective c字符串或者数据存入文件的封装 字符串存储到文件//存储publickey和sessionID -- writeContent: nil - 仅取出数据, 其他 - 修改原内容并提取+(NSString *)storeFile:(NSString *)file……继续阅读 » 水墨上仙 5年前 (2021-03-14) 3341浏览 1716个赞
字符串转成NSDate类型,计算与当前时间的相差,年数,天数,时分秒……NSString *dateStr=@"2013-08-13 20:28:40";//传入时间//将传入时间转化成需要的格式NSDateFormatter *format=[[NSDateFormatter alloc] init];[format set……继续阅读 » 水墨上仙 5年前 (2021-03-14) 2796浏览 1492个赞
在viewDidLoad中添加手势识别器,handleBackgroundTap:使文本字段取消第一响应者状态.- (void)viewDidLoad{ [super viewDidLoad]; // Do any additional setup after loading the view, typically from a nib.……继续阅读 » 水墨上仙 5年前 (2021-03-14) 3234浏览 2888个赞
iphone判断网络链接是否正常的代码+(BOOL)connectedToNetwork{ struct sockaddr_in zeroAddress; bzero(, sizeof(zeroAddress)); zeroAddress.sin_len = sizeof(zeroAddress); zeroAddres……继续阅读 » 水墨上仙 5年前 (2021-03-14) 1868浏览 244个赞
ios通过经纬度计算两个之间的距离+(double)distanceBetweenOrderBy:(double)lat1 :(double)lat2 :(double)lng1 :(double)lng2{ double dd = M_PI/180; double x1=lat1*dd,x2=lat2*dd; double y……继续阅读 » 水墨上仙 5年前 (2021-03-14) 3178浏览 1870个赞
ios View 向上拉界面代码#pragma mark - 上升效果- (void)ToUpSide { [self moveToUpSide];//向上拉界面 } - (void)moveToUpSide { [UIView animateWithDuration:0.7 //速度0.7秒 ……继续阅读 » 水墨上仙 5年前 (2021-03-14) 3024浏览 1134个赞
ios View 淡入淡出效果- (void)TheAnimation{ CATransition *animation = [CATransition animation]; animation.delegate = self; animation.duration = 0.7 ; // 动画持续时间(秒) ……继续阅读 » 水墨上仙 5年前 (2021-03-14) 1550浏览 872个赞
ios通过代码创建Tab Barself.tableViewController =[[TableViewController alloc] initWithNibName:@"TableViewController" bundle:nil];self.viewController = [[ViewController alloc……继续阅读 » 水墨上仙 5年前 (2021-03-14) 1831浏览 2313个赞
ios MBProgressHUD的使用方式,需要导入MBProgressHUD框架1、生命定义@property (nonatomic, strong) MBProgressHUD *progressBox; 2、初始化,此为视图居中显示self.progressBox = [[MBProgressHUD alloc] initWithVie……继续阅读 » 水墨上仙 5年前 (2021-03-14) 1556浏览 398个赞
iOS通过http post上传图片//ASIFormDataRequest方式 POST上传图片-(NSDictionary *)addPicWithDictionary:(NSDictionary *)sugestDic{ NSDictionary *tempDic=nil; NSString *url=[NSSt……继续阅读 » 水墨上仙 5年前 (2021-03-14) 3455浏览 503个赞
ios 调用打电话,发短信,打开网址//1、调用 自带mail [[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"mailto://admin@hzlzh.com"]]; //2、调用 电话phone [[UIApplication……继续阅读 » 水墨上仙 5年前 (2021-03-14) 3128浏览 648个赞
IOS设置输入框焦点becomeFirstResponder[self.myTextField becomeFirstResponder];……继续阅读 » 水墨上仙 5年前 (2021-03-14) 2386浏览 2625个赞
IOS在textFiled上面设置事件,实现轻触 Return 调用事件关闭键盘- (void)viewDidLoad{ myTextField =self.myTextField; [self.myTextField addTarget:self action:@selector(backgroundTap:) forControlE……继续阅读 » 水墨上仙 5年前 (2021-03-14) 3317浏览 1757个赞
C语言基础:通过指针遍历数组#include <stdio.h>int main(void) { int values[5] = {1, 2, 3, 4, 5}; int counter; int *iptr; iptr = values; for (counter = 0; counter < 5;……继续阅读 » 水墨上仙 5年前 (2021-03-14) 2943浏览 2520个赞
C语言基础:多重指针代码演示#include <stdio.h>int what_is_the_value(int ***ptr) { return(***ptr); }int main(void) { int *level_1, **level_2, ***level_3, value = 1001; leve……继续阅读 » 水墨上仙 5年前 (2021-03-14) 2687浏览 2786个赞
C语言基础:输出二维数组#include <stdio.h>int main(void) { int row, column; float table[3][5] = {{1.0, 2.0, 3.0, 4.0, 5.0}, {6.0, 7.0, 8.0, 9.0, 10.0},……继续阅读 » 水墨上仙 5年前 (2021-03-14) 2017浏览 2711个赞
C语言基础:遍历输出三维数组#include <stdio.h>int main(void) { int row, column, table; float values[2][3][5] = { {{1.0, 2.0, 3.0, 4.0, 5.0}, ……继续阅读 » 水墨上仙 5年前 (2021-03-14) 3124浏览 1683个赞
C语言基础:获取命令行传入的参数#include <stdio.h>int main (int argc, char **argv) { while (*argv) printf ("%s\n", *argv++);return 1; }……继续阅读 » 水墨上仙 5年前 (2021-03-14) 3539浏览 1817个赞
将该段代码置于Onclose或自定的响应消息的函数中 TCHAR szPath[MAX_PATH]; // GetModuleFileName(NULL, szPath, MAX_PATH); //获取当前应用程序的全路径 //定义俩变量,具体的请参见msdn STARTUPINFO st……继续阅读 » 水墨上仙 5年前 (2021-03-14) 1843浏览 2679个赞
C语言基础:atexit用法演示代码#include <stdio.h>#include <stdlib.h>void first(void) { printf("First function registered\n"); }void second(void) { printf(&q……继续阅读 » 水墨上仙 5年前 (2021-03-14) 1553浏览 571个赞
C语言基础:统计用户数组字符数量#include <stdio.h>int main (void) { long character_count = 0; getchar(); while (! feof(stdin)) { getchar(); character_count+……继续阅读 » 水墨上仙 5年前 (2021-03-14) 2482浏览 2310个赞
C语言基础:输出当前日期和时间#include <stdio.h>#include <time.h>int main (void) { time_t current_time; time(¤t_time); // Get the time in seconds; printf(&qu……继续阅读 » 水墨上仙 5年前 (2021-03-14) 2217浏览 364个赞
单链表反转: 比如原链表为 head->1->2->3->NULL; 反转后:head->3->2->1->NULL; #include <stdio.h>#include <stdlib.h>typedef struct Node{ int data; struct Node *next;}*List;#defi……继续阅读 » 水墨上仙 5年前 (2021-03-14) 3030浏览 421个赞
C语言基础:延迟执行#include <stdio.h>#include <time.h>int main (void) { time_t current_time; time_t start_time; printf("About to delay 5 seconds\n");……继续阅读 » 水墨上仙 5年前 (2021-03-14) 2445浏览 2829个赞
C语言基础:通过difftime判断时间间隔延迟执行#include <stdio.h>#include <time.h>int main (void) { time_t start_time; time_t current_time; time(&start_time); printf(&……继续阅读 » 水墨上仙 5年前 (2021-03-14) 1831浏览 250个赞
C语言基础:获得当前日期和时间#include <stdio.h>#include <time.h>int main (void) { struct tm *gm_date; time_t seconds; time(&seconds); gm_date = gmtime(&seco……继续阅读 » 水墨上仙 5年前 (2021-03-14) 1701浏览 2349个赞
C语言基础:计算儒略日#include <stdio.h>#include <time.h>int main(void) { time_t seconds; struct tm time_fields; time_fields.tm_mday = 4; time_fields.tm_mon = 7;……继续阅读 » 水墨上仙 5年前 (2021-03-14) 3607浏览 1034个赞
C语言基础:localtime输出当前日期和时间#include <stdio.h>#include <time.h>int main (void) { struct tm *current_date; time_t seconds; time(&seconds); current_date……继续阅读 » 水墨上仙 5年前 (2021-03-14) 1877浏览 2363个赞
C语言基础:mktime用法演示,输出时间差#include <stdio.h>#include <time.h>int main(void) { time_t seconds; struct tm time_fields; time_fields.tm_mday = 4; time_fields.……继续阅读 » 水墨上仙 5年前 (2021-03-14) 3084浏览 2859个赞
C语言基础:设置Timezone#include <stdio.h>#include <stdlib.h>#include <time.h>int main(void) { putenv("TZ=PST8PDT"); tzset(); printf("Curre……继续阅读 » 水墨上仙 5年前 (2021-03-14) 2573浏览 105个赞
C语言基础:时间转换成字符串 strftime#include <stdio.h>#include <time.h>int main(void) { char buffer[128]; struct tm *datetime; time_t current_time; tzset(); tim……继续阅读 » 水墨上仙 5年前 (2021-03-14) 2841浏览 2172个赞
C语言基础:timezone时区显示#include <stdio.h>#include <time.h>int main(void) { tzset(); printf("Difference between local and GMT is %d hours\n", timez……继续阅读 » 水墨上仙 5年前 (2021-03-14) 2041浏览 1724个赞
C语言去掉字符串首尾的 空格 换行 回车/*去掉字符串首尾的 \x20 \r \n 字符by sincoder*/void clean_string(char *str){ char *start = str - 1; char *end = str; char *p = str; while(*p) { switch(*p)……继续阅读 » 水墨上仙 5年前 (2021-03-14) 1631浏览 2475个赞
C语言基础:timezone名字显示#include <stdio.h>#include <time.h>int main(void) { tzset(); printf("Current time zone is %s\n", tzname[0]); if (tzname[1]) ……继续阅读 » 水墨上仙 5年前 (2021-03-14) 1881浏览 2644个赞
C语言基础:文件拷贝#include <stdio.h>int main(void) { FILE *input, *output; int letter; if ((input = fopen("\\CONFIG.SYS", "r")) == NULL) printf……继续阅读 » 水墨上仙 5年前 (2021-03-14) 3062浏览 1020个赞
C语言变成:磁盘检测代码片段#include <stdio.h>#include <dos.h>#include <malloc.h>void main(void) { struct fatinfo fat; long sector, total_sectors; void *buffer;……继续阅读 » 水墨上仙 5年前 (2021-03-14) 2169浏览 1802个赞
C语言基础:创建文件#include <stdio.h>#include <dos.h>#include <io.h>void main(void) { int handle; if ((handle = creatnew("NEW.DAT", 0)) == -1) ……继续阅读 » 水墨上仙 5年前 (2021-03-14) 2761浏览 2235个赞
C语言基础:创建临时文件夹#include <stdio.h>#include <dos.h>#include <io.h>void main(void) { char path[64] = "C:\\TEMP\\"; int handle; if ((handle = ……继续阅读 » 水墨上仙 5年前 (2021-03-14) 1892浏览 1646个赞
在N个元素中查找第K大元素,一般比较简单的方法就是先快速排序,然后直接返回array[N – K]或者利用扫描法,每一次扫描都找到当前数组中最大的元素,这个其实就是部分冒泡排序。前一种算法的时间复杂度是O(NlogN),后一种算法的时间复杂度是K*N。当然,这里我们不打算具体讨论以上两种方案,接下来看看其他方法。 &……继续阅读 » 水墨上仙 5年前 (2021-03-14) 1992浏览 837个赞
C++获取zip文件列表 // ZipFile.h #ifndef ZIPFILE_H#define ZIPFILE_H#include <string>#include <vector>#define ZIP_O……继续阅读 » 水墨上仙 5年前 (2021-03-14) 2798浏览 915个赞
正则表达式c语言经典实现/* * test.c * * Created on: 2012-12-4 * Author: Administrator */#include <stdio.h>int matchhere(char *,char *);int matchstar(int c,char *regexp,c……继续阅读 » 水墨上仙 5年前 (2021-03-14) 2596浏览 202个赞
一个简单的C语言随机数生成器int random(int start,int end){ int h; float k; h=(int)malloc(sizeof(int)); h=h%10000; k=((float)h)/10000; k=start+(end-start)*k; return k;}/** end of http……继续阅读 » 水墨上仙 5年前 (2021-03-14) 2894浏览 291个赞
C语言设计的简单的随机数字游戏,猜数字的游戏,只能在windows下运行/********************************************************************************************| C O M M E N T……继续阅读 » 水墨上仙 5年前 (2021-03-14) 1813浏览 455个赞