注: XCTest只能在iOS7以上的模拟器或设备中运行,所以在使用方法1、2时,Xcode中的指定的运行设备需为7.0以上的;而使用xcodebuild test
命令运行时需指定destination参数,选择7.0以上的模拟器或真实设备运行。否则会有错误提示:
“Library not loaded: /Developer/Library/Frameworks/XCTest.framework/XCTest”
The current thread’s run loop runs in the default mode (see “Default Run Loop Mode”) until the run loop is stopped with CFRunLoopStop or all the sources and timers are removed from the default run loop mode.
Run loops can be run recursively. You can call CFRunLoopRun from within any run loop callout and create nested run loop activations on the current thread’s call stack.
CFRunLoopStop
This function forces rl to stop running and return control to the function that called CFRunLoopRun or CFRunLoopRunInMode for the current run loop activation. If the run loop is nested with a callout from one activation starting another activation running, only the innermost activation is exited.
12345678
- (void)testAsyncTask
{
[taskManager execAsyncTaskWithCompletion:^(NSError *error) {
XCTAssertNil(error, @"Error should be nil");
CFRunLoopStop(CFRunLoopGetCurrent());
}];
CFRunLoopRun();
}
The value of this property is the same for apps that come from the same vendor running on the same device. A different value is returned for apps on the same device that come from different vendors, and for apps on different devices regardless of vendor. Normally, the vendor is determined by data provided by the App Store. If the app was not installed from the app store (such as when the app is still in development), the vendor is determined based on the app’s bundle ID. The bundle ID is assumed to be in reverse-DNS format, and the first two components are used to generate a vendor ID. For example, com.example.app1 and com.example.app2 would appear to have the same vendor ID.
If the value is nil, wait and get the value again later. This happens, for example, after the device has been restarted but before the user has unlocked the device.
The value in this property remains the same while the app (or another app from the same vendor) is installed on the iOS device. The value changes when the user deletes all of that vendor’s apps from the device and subsequently reinstalls one or more of them. The value can also when installing test builds using Xcode or when installing an app on a device using ad-hoc distribution. Therefore, if your app stores the value of this property anywhere, you should gracefully handle situations where the identifier changes.
在Settings.app -> Privacy -> Advertising设置有一项Limit Ad Tracking,是否限制广告跟踪,目前这一选项没有实质性作用。
在开发文档中对advertisingTrackingEnabled这样描述
Check the value of this property before performing any advertising tracking. If the value is NO, use the advertising identifier only for the following purposes: frequency capping, conversion events, estimating the number of unique users, security and fraud detection, and debugging.
advertisingTrackingEnabled为NO,即Limit Ad Tracking为’ON’状态;这只是设置一个标识告诉广告商(advertisers)不要使用
Advertising ID对用户进行针对性的广告匹配;但没有任何强制措施来保证这一点,对访问advertisingIdentifier也没有任何限制。
In iOS 7 and later, if you ask for the MAC address of an iOS device, the system returns the value02:00:00:00:00:00. If you need to identify the device, use the identifierForVendor property ofUIDevice instead. (Apps that need an identifier for their own advertising purposes should consider using the advertisingIdentifier property of ASIdentifierManager instead.)
UUIDs (Universally Unique Identifiers), also known as GUIDs (Globally Unique Identifiers) or IIDs (Interface Identifiers), are 128-bit values A UUID is made unique over both space and time by combining a value unique to the computer on which it was generated and a value representing the number of 100-nanosecond intervals since October 15, 1582 at 00:00:00.
To start using RVM you need to run `source /Users/xuguoxing/.rvm/scripts/rvm`
in all your open shell windows, in rare cases you need to reopen all shell windows.
安装Ruby 1.9.3(Octopress使用)
123
rvm install 1.9.3
rvm use 1.9.3
rvm rubygems latest
Usage: imageOptim [options]
Options:
-d, --directory directory of images to process
-a, --image-alpha pre-process PNGs with ImageAlpha.app *
-j, --jpeg-mini pre-process JPGs with JPEGmini.app **
-q, --quit quit all apps when complete
-h, --help display this usage information
-e, --examples display some example commands and uses
-v, --version display the version number
* http://pngmini.com
** https://itunes.apple.com/us/app/jpegmini/id498944723
rake generate # Generates posts and pages into the public directory
rake watch # Watches source/ and sass/ for changes and regenerates
rake preview # Watches, and mounts a webserver at http://localhost:4000
使用rake preview可在本地http://localhost:4000预览生成效果。
六.配置Octopress
配置文件包括
_config.yml # Main config (Jekyll's settings)
Rakefile # Configs for deployment
config.rb # Compass config
config.ru # Rack config
url: # For rewriting urls for RSS, etc
title: # Used in the header and title tags
subtitle: # A description used in the header
author: # Your name, for RSS, Copyright, Metadata
simple_search: # Search engine for simple site search
description: # A default meta description for your site
date_format: # Format dates using Ruby's date strftime syntax
subscribe_rss: # Url for your blog's feed, defauts to /atom.xml
subscribe_email: # Url to subscribe by email (service required)
category_feeds: # Enable per category RSS feeds (defaults to false in 2.1)
email: # Email address for the RSS feed if you want it.
root: # Mapping for relative urls (default: /)
permalink: # Permalink structure for blog posts
source: # Directory for site source files
destination: # Directory for generated site files
plugins: # Directory for Jekyll plugins
code_dir: # Directory for code snippets (for include_code plugin)
category_dir: # Directory for generated blog category pages
pygments: # Toggle python pygments syntax highlighting
paginate: # Posts per page on the blog index
pagination_dir: # Directory base for pagination URLs eg. /blog/page/2/
recent_posts: # Number of recent posts to appear in the sidebar
default_asides: # Configure what shows up in the sidebar and in what order
blog_index_asides: # Optional sidebar config for blog index page
post_asides: # Optional sidebar config for post layout
page_asides: # Optional sidebar config for page layout
第三方设置
Github – 在侧边栏列出 github repositories
Twitter – 设置twitter用户名(不带@),添加Twitter分享按钮
Google Plus One – Setup sharing for posts and pages on Google’s plus one network.
Pinboard – Share your recent Pinboard bookmarks in the sidebar.
Delicious – Share your recent Delicious bookmarks in the sidebar.
Disqus Comments – Add your disqus short name to enable disqus comments on your site.
Google Analytics – 添加Google Analytics的tracking id分析页面访问.
Facebook – 添加Facebook like按钮
Google Analytics的tracking id在Google Analytics页面的 管理->媒体资源->跟踪代码中可以找到