自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(56)
  • 收藏
  • 关注

转载 再添加tableviewheader時注意

- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section使用此方法添加header的时候,header不会随着tableview的滚动而滚动需要注意,重写自定义header(继承自uiview)的setFrame方法,- (void)setFrame:(CG...

2016-01-18 11:11:00 104

转载 Android 微博登录“sso package or sign error” 错误解决方案! (转)

新版微博客户端升级功能,无线应用使用sso授权必须填写包名、签名。否则会遇到sso package or sign error的报错,SSO授权暂时只针对iOS及Android端。如果在使用SSO授权时,仍然发生sso package or sign error的报错,请根据以下方法自行排查:(1)检查应用包名签名信息是否完善如果你的应用只有一个包名、签名,请在 http://open....

2015-12-29 10:07:00 242

转载 cmmotionmaneger

http://justsee.iteye.com/blog/1933099from : http://mobile.51cto.com/iphone-285018.htmiOS4中Core Motion框架使用方法是本文要介绍的内容,主要是来学习IOS4中框架的内容。在iOS4之前,加速度计由UIAccelerometer类来负责采集工作,而电子罗盘则由Core Location...

2015-11-21 11:44:00 190

转载 CAShapeLayer

UIView *showView = [[UIView alloc] initWithFrame:CGRectMake(100, 100, 100, 100)]; [self.view addSubview:showView]; showView.backgroundColor = [UIColor redColor]; showView.al...

2015-11-20 13:57:00 76

转载 Xcode7 使用NSURLSession发送HTTP请求的问题

Xcode7 使用NSURLSession发送HTTP请求的问题Application Transport Security has blocked a cleartext HTTP (http://) resource load since it is insecure. Temporary exceptions can be configured via your app'...

2015-11-08 15:43:00 59

转载 iOS开发摇动手势实现详解

1.当设备摇动时,系统会算出加速计的值,并告知是否发生了摇动手势。系统只会运动开始和结束时通知你,并不会在运动发生的整个过程中始终向你报告每一次运动。例如,你快速摇动设备三次,那只会收到一个摇动事件。2,想要实现摇动手势,首先需要使视图控制器成为第一响应者,注意不是单独的控件。成为第一响应者最恰当的时机是在视图出现的时候,而在视图消失的时候释放第一响应者。...

2015-11-05 09:45:00 140

转载 解析xcode6 autolayout

我们知道,一款iOS应用,其主要UI组件是由一个个相对独立的可视单元构成,这些可视单元有的主要负责向用户输出有用的信息,有些则负责信息的输 入(交互),交互的过程中往往还伴随有动画的效果,已达到整个信息传递的连贯性以及用户体验的细腻感。可视单元,在实际开发中主要是view、 button等,那么这些可视单元的关系由两个基本的关系构成:兄弟关系和父子关系,整个视图单元就是一个树...

2015-11-04 14:05:00 78

转载 leetcode_28_ Implement strStr() (easy)

Implement strStr()Implement strStr().Returns the index of the first occurrence of needle in haystack, or -1 if needle is not part of haystack. Update (2014-11-02):The signature of the f...

2015-11-03 18:01:00 71

转载 __block在arc和非arc下含义一样吗?

Block属性的声明,首先需要用copy修饰符,因为只有copy后的Block才会在堆中,栈中的Block的生命周期是和栈绑定的,可以参考之前的文章(iOS: 非ARC下返回Block)。比如这样一个Block类型:typedef void (^MyBlockType)(int); @property (copy) MyBlockType myBlock;...

2015-11-02 20:13:00 117

转载 请解释以下keywords的区别: assign vs weak, __block vs __weak

assign vs weak, __block vs __weak字数364 阅读74 评论0 喜欢0 在objective-c中,类中的全局变量经常使用如下的方式申明。@property(nonatomic(1),strong(2))UIImageView *imageView;其中的1,2处是对此变量的一些属性申明。有以下几种strong weakassignst...

2015-11-02 17:11:00 112

转载 copy,assign,strong,retain,weak,readonly,nonatomic的区别

1、weak和strong区别不同的是 当一个对象不再有strong类型的指针指向它的时候 它会被释放 ,即使还有weak型指针指向它。  一旦最后一个strong型指针离去 ,这个对象将被释放,所有剩余的weak型指针都将被清除。  可能有个例子形容是妥当的。  想象我们的对象是一条狗,狗想要跑掉(被释放)。  strong型指针就像是栓住的狗。只要你用牵绳挂住狗,狗就不会跑掉。如...

2015-11-02 16:58:00 80

转载 什么事arc

ARC是什么ARC是iOS 5推出的新功能,全称叫 ARC(Automatic Reference Counting)。简单地说,就是代码中自动加入了retain/release,原先需要手动添加的用来处理内存管理的引用计数的代码可以自动地由编译器完成了。该机能在 iOS 5/ Mac OS X 10.7 开始导入,利用 Xcode4.2 可以使用该机能。简单地理解ARC,就是通...

2015-11-02 16:51:00 70

转载 网上看到了一些ios面试题,看着解答解答

著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。作者:高峰链接:http://www.zhihu.com/question/19604641/answer/44151044来源:知乎1. 什么是arc?(arc是为了解决什么问题诞生的?)2. 请解释以下keywords的区别: assign vs weak, __block vs __weak3. __bl...

2015-11-02 16:48:00 57

转载 leetcode_27_ Remove Element (easy)

Remove ElementGiven an array and a value, remove all instances of that value in place and return the new length.The order of elements can be changed. It doesn't matter what you leave beyond t...

2015-11-02 11:15:00 66

转载 leetcode_26_ Remove Duplicates from Sorted Array (easy)

Remove Duplicates from Sorted Array题目:Given a sorted array, remove the duplicates in place such that each element appear only once and return the new length.Do not allocate extra space for ...

2015-10-26 20:40:00 67

转载 leetcode_20_Valid Parentheses (easy)

Valid Parentheses题目:Given a string containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid.The brackets must close in the correct order, "()" ...

2015-10-23 10:21:00 47

转载 leetcode_19_Remove Nth Node From End of List (easy)

Remove Nth Node From End of List题目:Given a linked list, remove the nth node from the end of list and return its head.For example, Given linked list: 1->2->3->4->5, and n = 2...

2015-10-23 09:22:00 92

转载 leetcode_14_Longest Common Prefix (easy)

Longest Common Prefix题目:Write a function to find the longest common prefix string amongst an array of strings.找出所有字符串的最长公共前缀。解题:string&&vectorhttp://blog.chinaunix.net/uid-26...

2015-10-22 22:02:00 87

转载 leetcode_13_Roman to Integer (easy)

Roman to Integer题目:Given a roman numeral, convert it to an integer.Input is guaranteed to be within the range from 1 to 3999.解题: 首先我们先观察罗马数字的规律罗马数字共有七个,即I(1),V(5),X(10),L...

2015-10-19 15:44:00 63

转载 leetcode_09_Palindrome Number (easy)

Palindrome Number题目:Determine whether an integer is a palindrome. Do this without extra space.click to show spoilers.Some hints:Could negative integers be palindromes? (ie, -1)If you ...

2015-10-18 09:21:00 65

转载 Leetcode_06_ZigZag Conversion (easy)

ZigZag Conversion------(String)题目:The string"PAYPALISHIRING"is written in a zigzag pattern on a given number of rows like this: (you may want to display this pattern in a fixed font for ...

2015-10-17 11:04:00 96

转载 leetcode_07_Reverse Integer (easy)

题目:Reverse IntegerTotal Accepted: 102355 Total Submissions: 436373 Difficulty: Easy Reverse digits of an integer. Example1: x = 123, return 321Example2: x = -123, return -321H...

2015-10-17 11:01:00 74

转载 独立游戏人:像素风格游戏制作分享(转)

独立游戏人:像素风格游戏制作分享文/vikingzombie像 素风格在独立游戏中非常火,我也挺喜欢玩像素风格的游戏。特别是独立游戏大电影里介绍的《Fez》,在我心目中的游戏榜单能排到前5。我也想做像素风格的 游戏,在经过一段时间的研究学习后,有了些心得,现在把我博客里的一篇文章贴出来,权当抛砖引玉,希望对同样喜欢像素风格,计划做像素游戏的人有所帮助。...

2015-09-07 21:42:00 1082

转载 关于iphone开发中的@property和@synthesize的一些见解(转)

我的体会是@property和@synthesize有以下两个作用:1.作用一@property是在头文件.h中声明一个变量的setter和getter方法。@synthesize是在m文件中定义setter和getter方法的实现。2.作用二@property,在声明变量方法的时候可以附加定义该变量的属性。如retain,assign,readonly,nonaut...

2015-04-11 16:03:00 69

转载 iphone开发cocoa中nil,NSNull,Nil的使用区别

1,nil的简单定义你可能还不知道nil在Objective-C中是什么意思。为了避免混乱,先简单定义一下nil:nil表示一个对象指针不指向任何对象时的值。如果你熟悉其它源自C语言的语言,你可能会问:NULL和nil是一样的吗?答案是基本一样。NULL可以用在C语言的各种指针上,而nil用在Objective-C的对象指针上。如果你在xcode上右击nil,查看...

2015-04-11 01:27:00 59

转载 Xcode6.1创建仅xib文件无storyboard的hello world应用(转)

--恢复内容开始---由于Xcode6之后,默认创建storyboard而非xib文件,而作为初学,了解xib的加载原理很重要,所以,需要创建一个没有storyboard的项目1. 创建一个新的工程2. 选择仅一个视图的模板选择 Single View Application , 点击Next3. 填写项目信息不需要选择core data,填好信息...

2015-04-10 18:20:00 62

转载 iOS 学习资料整理(转)

视频教程(英文)视频教程(中文)书籍博客文章相关网站社区工具/插件GitHub Top 50 简介邮件订阅文档指南Awesome 系列知乎上的讨论Quora 上的讨论贡献者License这份学习资料是为 iOS 初学者所准备的, 旨在帮助 iOS 初学者们快速找到适合自己的学习资料, 节省他们搜索资料的时间...

2015-04-06 12:21:00 176

转载 hdoj1042ac

#include<stdio.h>int main(){ int a[10000]; int n,i,j,c,m; while(EOF!=scanf("%d",&n)){ a[0]=1; m=0; for(i=1;i<=n;i++){ c=0; for(j=0;j<=m;j++){ a[j]=a[j]*i+c; c=a[j]/10...

2015-04-05 15:18:00 43

转载 hdoj1013 wa(待改正)

#include <stdio.h>#include <stdlib.h>int main(){ char a[100000]; int x,i; while(EOF!=scanf("%s",a)&&a[0]!='0'){ x=10; while(x>9){ for(i=0,x=0;a[i]!='\0';i++) ...

2015-04-05 11:30:00 58

转载 函数itoa

在C语言里,一串数字也是字符串,比如s[100]="123456",并输出printf("%s",s); 这样可以输出数字字符串。 当然,数字还有另一种理解,比如:int a=1234; 怎么样把整型a赋值给字符串,这里有一个很重要的函数 itoa,简单的来说,这个函数就是把整型数据按照你给的进制存放入字符串内(想了解这个函数更详细的情况,可以用谷歌百度一下)。这个函数的...

2015-04-05 10:51:00 104

转载 1006

一种方法,记录一下,以便日后查找……Problem DescriptionThe three hands of the clock are rotating every second and meeting each other many times everyday. Finally, they get bored of this and each of them would ...

2015-04-02 23:29:00 53

转载 一种不用参数交换两变量值的方法

除了最简单的三变量法外还有一种不用参数的交换法#include <stdio.h>int main(){ int a,b; scanf("%d%d",&a,&b); a=a+b; b=a-b; a=a-b; printf("%d %d\n",a,b); return 0;}这种方法范围窄,只有定义了加减法的数据类型才可以使用...

2015-04-01 10:40:00 125

转载 输入三位数,翻转输出

错误:#include <stdio.h>#include <stdlib.h>int main(){ int a; int b,c,d; scanf("%d",&a); b=a-100*a/100-10*(a/10-10*a/100); c=a/10-10*a/100; d=a/100; printf("%d%d%d\n",b,c,d); s...

2015-04-01 10:28:00 150

转载 一个简单的问题

#include <stdio.h>#include <stdlib.h>int main(){ printf("%f",8.0/5.0); system("pause"); return 0;}no.18.0/5.0改成8/5结果:0.000000no.2%f改成%d结果-1717986918转载于:https://www.c...

2015-04-01 09:39:00 68

转载 1006ac(转)

开始我以为是一秒一秒动,后来才想到是连续的本题目采用解方程方法 利用22针的度数差值函数 解方程Vs = 6度每秒 (60秒走一圈360度 360/60=6)Vm = 1/10度每秒(3600秒,一个小时走一圈, 360/3600=0.1)Vh = 1/120度每秒(12小时走一圈,360/(3600*12)= 1/120)然后,就可以得到每两根之间的速度差了:Vsm = Vs -...

2015-03-31 15:51:00 105

转载 1007(转)

超时原因,注释内为超时代码for(i=begin;i<=end;i++){ /* if(i<mid&&(a[mid].x-a[i].x)<midmin) b[cout1++]=a[i]; if(i>mid&&(a[i].x-a[mid].x)<midmin) c[cout2++]=a[i]...

2015-03-31 15:35:00 91

转载 杭电oj1004 自写成功代码

#include<stdio.h>#include<malloc.h>#include<string.h>typedef struct Color{ char name[16]; int num; struct Color *next;}Color,*COLOR;void Init(Color *head){ char a[16]="0"; h...

2015-03-30 22:44:00 126

转载 1004

如有一个类Color,有成员变量nextColor *head;只是定义一个指针,不能使用head->next;除非head=(Color *)malloc(sizeof(COLOR));转载于:https://www.cnblogs.com/ganeveryday/p/4379421.html...

2015-03-30 22:33:00 66

转载 杭电oj1005 wrong answer(待改正)

#include<stdio.h>int main(){ int c[51]={1,1}; int time; int a,b,n; int i; while(scanf("%d %d %d",&a,&b,&n)!=EOF){ if(a==0&&b==0&&n==0) break; a%=7; b%=7...

2015-03-30 18:41:00 143

转载 杭电oj1005解题

1005AC+解题思路分析:1,题中(1 <= A, B <= 1000, 1 <= n <= 100,000,000),可知用蛮力肯定行不通。2, (A * f(n - 1) + B * f(n - 2)) mod 7 =(A%7*f(n-1)+B%7*f(n-2))%73,因f(i)和f(i+1) 只有49种组合,因为(f...

2015-03-30 18:10:00 286

空空如也

空空如也

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

TA关注的人

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