2.How to present a view controller on iOS7 without the status bar overlapping?
Solution:The easiest workaround I’ve found is to wrap the view controller you want to present inside a navigation controller, and then present that navigation controller.
// First you can figure out which version of Cocoapods you are on with the command:
$ pod --version
// You can also see all the version of Cocoapods you have installed with this command:
$ sudo gem list cocoapods
// Next uninstall Cocoapods. If you have multiple version, you will have the choice of uninstalling all or a specific version.
$ sudo gem uninstall cocoapods
// Finally you can install the specific version with this command:
$ sudo gem install cocoapods -v 0.39.0
8.How to get UISearchDisplayController to search only after search button is pressed?
A:Setup a delegate for the search bar and implement the searchBarSearchButtonClicked: method. Do your searching from that method. Just return NO from the shouldReloadTableForSearchString method.
9.Warning: the running version of Bundler is older than the version that created the lockfile. We suggest you upgrade to the latest version of Bundler by running gem install bundler.
$ sudo gem install bundler
$ bundle install
...
An error occurred while installing git (1.2.9.1), and Bundler cannot continue.
Make sure that `gem install git -v '1.2.9.1'` succeeds before bundling.
$ sudo gem install git -v '1.2.9.1'
$ sudo gem install lowdown -v '0.0.5' --verbose
...
ERROR: Error installing lowdown:
lowdown requires Ruby version >= 2.1.0.
$ ruby --version
ruby 2.0.0p645 (2015-04-13 revision 50299) [universal.x86_64-darwin15]
// On OS X machines, you can use third-party tools (rbenv and RVM).
// Install RVM:
$ \curl -sSL https://get.rvm.io | bash -s stable --ruby=2.1.8
* To start using RVM you need to run `source /Users/dongmeiliang/.rvm/scripts/rvm`
in all your open shell windows, in rare cases you need to reopen all shell windows.
$ source /Users/dongmeiliang/.rvm/scripts/rvm
// Check rvm has been installed successfully
$ rvm --help
$ bundle install
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/dependency.rb:296:in `to_specs': Could not find 'bundler' (>= 0) among 13 total gem(s) (Gem::LoadError)
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/dependency.rb:307:in `to_spec'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_gem.rb:47:in `gem'
from /usr/local/bin/bundle:22:in `<main>'
We need reinstall bundler after update ruby:
$ gem install bundler
Fetching: bundler-1.11.2.gem (100%)
Successfully installed bundler-1.11.2
Parsing documentation for bundler-1.11.2
Installing ri documentation for bundler-1.11.2
Done installing documentation for bundler after 6 seconds
1 gem installed
//bundle - Ruby Dependency Management
//gem -- RubyGems program, RubyGems is a sophisticated package manager for Ruby.
//rvm - The Ruby Version Manager
A:KeyChain Access > select the System keychain > View > Show Expired Certificates > delete the expired version of the Apple Worldwide Developer Relations Certificate Authority Intermediate certificate (expired on February 14, 2016)
12. FMDB unable to open db under Application Support directory.
A:Unlike the Documents directory, the Application Support directory does not exist in the app’s sandbox by default. You need to create it before you can use it.
123456789101112
NSURL * ApplicationSupportDirectory()
{
NSURL *applicationSupportDir = URLOfDirectory(NSApplicationSupportDirectory);
if (applicationSupportDir) {
// If the directory does not exist, this method creates it.
// This method is only available in OS X v10.7 and iOS 5.0 or later.
[[NSFileManager defaultManager] createDirectoryAtURL:applicationSupportDir withIntermediateDirectories:YES attributes:nil error:nil];
}
return applicationSupportDir;
}
15.ld: warning: directory not found for option ‘-F/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator9.2.sdk/Developer/Library/Frameworks’