自动引用计数(ARC)和垃圾回收(GC)
在Java或者Javascript的开发中,我们会碰到垃圾回收(Garbage Collection,GC),它和iOS中的自动引用计数(Auto Reference Count,ARC)有什么区别呢?
Read on →在Java或者Javascript的开发中,我们会碰到垃圾回收(Garbage Collection,GC),它和iOS中的自动引用计数(Auto Reference Count,ARC)有什么区别呢?
Read on →Contents:
In Cocoa, the Model-View-Controller pattern, a controller’s responsibility is to keep the view and the model synchronized. There are two parts to this: when the model object changes, the views have to be updated to reflect this change, and when the user interacts with controls, the model has to be updated accordingly.
Key-Value Observing helps us update the views to reflect changes to model objects. The controller can observe changes to those property values that the views depend on.
For more details, refer Key-Value Coding and Observing from objc.io;
Read on →Refer Mac和iOS开发资源汇总
Another good github page for iOS resources: iOS 学习资料整理.
其中,最近(2015年)仍然在更新的中文博客:
Read on →TODO
All the attributes of a property defines how the compiler generate the getter
and setter
accessors.
setter
accessor.readonly
, the compiler will only declare the getter accessor, so that you can not call setter accessor.This post is deprecated. Refer to Propety, Instance Variable and @synthesize.
Read on →For iOS SDK 8.0 and later, we need to set NSLocationWhenInUseUsageDescription
and ‘NSLocationAlwaysUsageDescription’ in info.plist file. A sample case is:
1 2 3 4 |
|
The string
will appear in the popup dialog. You can leave it as empty, and only the system message will appear in the popup.
Write your own overlay class (for example, MapOverlay
) confirm to MKOverlay
, synthesize coordinate
and boundingMapRect
, so that we can assign value to them while initializing it.
Note that the type of coordinate
is CLLocationCoordinate2D
with latitude
and longitude
, while boundingMapRect
is MKMapRect
. And we need to use MKMapPointForCoordinate
method to convert a CLLocationCoordinate2D
type data to MKMapPoint
type data. If we assign the CLLocationCoordinate2D
data directly to boundingMapRect
, the overlay will be too small to draw, and the mapView:rendererForOverlay:
method will not be called at all. It is very hard for debugging.
[updated 2015.09.13] This adding method is only for my project pages (gh-pages) GitBlogs, and for octopress, the way is builded in.
[updated 2015.06.07] For adding category or tag automatically through python script, go to here.
The index page includes cat_tag_for_index.html for showing all the categories and tags, and the number of the corresponding posts.
The _layouts/default.html describes the content of a post, because post includes it. In the _layout/default.html file, it includes the cat_tag.html template as the category and tag info in the beginning of the post. And cat_tag.html also includes the date behind.
_data/categories.yml and _data/tags.yml describe all the categories and tags.
Read on →[updated 2015.10.30] The followings ways for deploying posts is deprecated. Refer to deploying octopress for details. But if you knows things this post descripbes, you will have better understanding of octopress.
[updated 2015.09.13] Github has two kind of pages: user/orgnization pages and project pages (gh-pages).
Currently, I am using the user/orgnization pages deployed by octopress. This is recommended, due to the easy deployment.
If you are using the project pages (gh-pages), the following references may be help.
Refer to “一步步在GitHub上创建博客主页”.
I tried the this one. It works well.
I didn’t try the debugger yet.
[updated 2015.10.30] The following way is for my previous blog, and now I am using octopress for my blog.
The following is for my project pages (gh-pages) GitBlogs.
The python script is put GitBlogs/tools/add.py.
For adding category or tag:
python add.py -category category_name
or python add.py -tag tag_name
for adding category and tag respectively.Vim is an editor to create or edit a text file.
Two modes:
[updated 2015.10.30] The following way is deprecated, and octopress way is prefered. But the To make the post searchable by Google part is still in use.
Contents:
The first two sections are only for my project pages (gh-pages) GitBlogs, and currently in cotopress blog, we have other new simpler ways to do these things. See Migrate Blog to Octopress.
This post is not for how to deploy the environment of writing posts in github pages, but how to use the environment you deployed before.
Read on →[updated on 2015.9.17] With Xcode 7, we only need an Apple ID for deploying your app to ipad or iphone, with the ability to debug.
Read on →Define a function addTimer, to log executed time for all function-type property of an object