Another year,so many things changed,so many people left,I don’t know what to do,but carry on and on.
Viva la vida!
When you are old and grey and full of sleep
And nodding by the fire,take down this book
And slowly read,and dream of the soft look
Your eyes had once, and of their shadows deep;
How many loved your moments of glad grace,
And loved your beauty with love false or true,
But one man loved the pilgrim soul in you,
And loved the sorrows of your changing face;
And bending down beside the glowing bars,
Murmur,a little sadly,how love fled
And paced upon the mountains overhead
And hid his face amid a crowd of stars.
(BY William Butler Yeats)
1 Jan 2015 #poem
ios7中添加了调用 snapshotViewAfterScreenUpdates
创建一个复合视图的快照。然后返回一个uiview
对象来表示调用视图的整体外观。
Supplying YES for -snapshotViewAfterScreenUpdates: means it needs a trip back to the runloop to actually draw the image. If you supply NO, it will try immediately, but if your view is off screen or otherwise hasn’t yet drawn to the screen, the snapshot will be empty.
因为返回的是一个view对象,所以,你可以更改它以及它的layer属性.但是呢,你不能够修改它的layer的content属性;如果你试图这么做,将不会有任何效果.如果当前的view还没有渲染,或者这么说吧,因为还没有出现在屏幕上,那么,这个截取的view将不会有能显示的content.
如果你想要加载一个图形效果,比如blur,请使用这个方法 drawViewHierarchyInRect:afterScreenUpdates:
来代替.
NSOperation是一个抽象的基类,表示一个独立的计算单元,可以为子类提供有用且线程安全的建立状态,优先级,依赖和取消等操作。系统已经给我们封装了NSBlockOperation和NSInvocationOperation这两个实体类。
17 Nov 2014 #iOS #NSOperation
SQLite是一个进程内的库,实现了自给自足的、无服务器的、零配置的、事务性的 SQL 数据库引擎。它是一个零配置的数据库,这意味着与其他数据库一样,您不需要在系统中配置。 就像其他数据库,SQLite 引擎不是一个独立的进程,可以按应用程序需求进行静态或动态连接。SQLite 直接访问其存储文件。
由于iOS无法通过html表单来上传图片,因此想要上传图片,必须实现http请求,而不能像其他语言那样通过html表单的post就能上传。
上传图片的http post请求的格式是这样的:
Content-type: multipart/form-data, boundary=---------------------------14737809831466499882746641449
---------------------------14737809831466499882746641449
Content-Disposition: form-data; name="pic"; filename="boo.jpg"
Content-Type: image/jpeg
... contents of boo,jpg ...
---------------------------14737809831466499882746641449
Content-Disposition: form-data; name="info"
Hello Boris!
---------------------------14737809831466499882746641449
C中的宏分为两类,对象宏(object-like macro)和函数宏(function-like macro)。对于对象宏来说确实相对简单,但却也不是那么简单的查找替换。对象宏一般用来定义一些常数,举个例子:
#define M_PI 3.14159265358979323846264338327950288
#define
关键字表明即将开始定义一个宏,紧接着的M_PI
是宏的名字,空格之后的数字是内容。类似这样的#define X A
的宏是比较简单的,在编译时编译器会在语义分析认定是宏后,将X替换为A,这个过程称为宏的展开。比如对于上面的M_PI
直接使用。
到https://github.com/ccgus/fmdb 下载源文件,然后直接将fmdb文件夹拖入到你的工程就OK。 当然你需要添加依赖库:libsqlite3.dylib
拖入源文件,并且添加依赖库以后你就可以使用FMDB了,引用头文件
#import "FMDB.h"
NSNotification 一个对象通知另外一个对象,可以用来传递参数、通信等作用,与delegate的一对一不同,通知是一对多的。在一个对象中注册了通知,那么其他任意对象都可以来对这个对象发出通知。
3 Jul 2014 #iOS #NSNotification