Operating Files and Folders With Command Line in Terminal
为什么需要在命令行进行文件和文件夹的操作:
Read on →iOS中的触控事件机制
在iOS中有三类事件:
- 触控事件(单点、多点触控以及各种手势操作)
- 传感器事件(重力、加速度传感器等)
- 远程控制事件(远程遥控iOS设备多媒体播放等)
这里要讨论的是触控事件的机制。
iOS中主要有两种触控事件:
- 手势识别类定义的触控事件
- UIResponder中定义的触控事件
Migrate Blog to Octopress
For basic configuration of octopress blog, go to official site for references.
Issue with OS EI Caption (10.11)
After updating OS to EI Caption (10.11), there is some bugs when we run rake preview
. You need to update your ruby version, and reinstall dependencies of octopress.
Refer to Errno::ENOENT: No Such File or Directory - Jekyll ~ Octopress and El Capitan post for more details.
If you can still not update your ruby version using the way in the above post, try the following commands (Refer to Using Rbenv to Manage Multiple Versions of Ruby for more details.) before install new ruby version:
- Add rbenv init to your shell to enable shims and autocompletion:
1 2 |
|
- Restart shell as a login shell so that the PATH changes take effect:
1
|
|
Themes
Go to here to choose the theme you like. Personally, I like the boldandblue theme. It is simple and elegant.
Read on →Singleton
Shortcut of Chrome on Windows and Mac
Use shortcut to improve productivity while using Chrome.
A full page is on Chrome helper:
I will list some common used ones here by myself.
Read on →Warning Messages in Xcode
Compiler Warnings for Objective-C Developers is a good post for describing warning messages for Objective-C in xcode. A Chinese version can be found 谈谈Objective-C的警告.
Some important things are marked here.
Two ways to modify complier’s warning setting: UI Method and Custom Compiler Flags Method.
Read on →How to Use Google Maps Android API Utility Library in Android Studio
Google Maps Android API utility library (the github repo and the documentation) supplies multiple cool features, including
- Marker clustering — handles the display of a large number of points
- Heat maps — display a large number of points as a heat map
- IconGenerator — display text on your Markers
- Poly decoding and encoding — compact encoding for paths, interoperability with Maps API web services
- Spherical geometry — for example: computeDistance, computeHeading, computeArea
- KML — displays KML data (Caution: Beta!)
- GeoJSON — displays and styles GeoJSON data
Deploy Environment for Android Map Development
Contents:
The following suggestions are all based on Windows. It should be similar on Mac.
Read on →Some Frameworks in iOS Development
The .dSYM File in Ios Project
Description
A .dSYM file is a debug symbols file. It is generated when in xcode:
Generate Debug Symbols
setting is enabledDebug Infomation Format
is set toDWARF with dSYM File
in the build settings of your project.
自动引用计数(ARC)和垃圾回收(GC)
在Java或者Javascript的开发中,我们会碰到垃圾回收(Garbage Collection,GC),它和iOS中的自动引用计数(Auto Reference Count,ARC)有什么区别呢?
Read on →Understanding KVC and KVO in Objective-C
Contents:
Description
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 →Resources for iOS Developers
Refer Mac和iOS开发资源汇总
Another good github page for iOS resources: iOS 学习资料整理.
其中,最近(2015年)仍然在更新的中文博客:
Read on →Font Size in Html - Px, Em, Rem
Ios App Life Circle and Related Interfaces
TODO
Communication Between WebView and Native Android
Property and Its Attributes in Objective-C
All the attributes of a property defines how the compiler generate the getter
and setter
accessors.
- atomic / nonatomic
- strong / weak: used for ARC.
- assign / retain / copy: go to here for reference. These properties define how the compiler generate the
setter
accessor. - readonly / readwrite: if a property is declared as
readonly
, the compiler will only declare the getter accessor, so that you can not call setter accessor.
Property vs Instance Variable (iVar) in Objective-c
This post is deprecated. Refer to Propety, Instance Variable and @synthesize.
Read on →Use Current Location Service in Map
Location Service Authorization
1. Set info.plist
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.