///////////////////////////////////////1///////////////////////////////////////
I. How to use a third-party framework
* Search online/or directly on the SDK website
* Find the corresponding download location
* Download SDK package corresponding to application development platform
* Read through the SDK's documentation to integrate the SDK with Project engineering
* After integrating SDK package, use the SDK function according to the prompt demo code (using steps)
third, the iOS8.0 after positioning the required configuration key
Privacy-bluetooth Peripheral Usage Description
/** Position Authorization * /
nslocationalwaysusagedescription
/** Front Desk Location authorization * /
nslocationwheninuseusagedescription
Iv. When using the view model, note
* Which view model to use, the header file of which view model should be imported
///////////////////////////////////////2///////////////////////////////////////
View Model Transformation principle:
//dictionary array to model array
Nsarray *themeitems = [tjtopicitem mj_objectarraywithkeyvaluesarray:responseobject[@ "List"];
//Create variable array
Nsmutablearray *themeitem = [Nsmutablearray array];
traversing an array model
For (Tjtopicitem *item on themeitems) {
//Create a View model object
Tjthemeviewmodel *VM = [Tjthemeviewmodel alloc] init]
Vm.item = Item;
//Save view View Model
[Themeitem ADDOBJECT:VM];
self.themeviewmodels = Themeitem;
}
Login Test http:
* Http://120.25.226.186:32812/login
* account password: Username=%@&pws=%@&type=json
///////////////////////////////////////3///////////////////////////////////////
installing Alcatraz in Xcode 7
first step: Turn off Xcode.
Step Two: If you have previously installed Alcatraz, uninstall it. Run Command
rm-rf ~/library/application\ Support/developer/shared/xcode/plug-ins/alcatraz.xcplugin
Step Three: The most critical step is to run the command:
Find ~/library/application\ support/developer/shared/xcode/plug-ins-name info.plist-maxdepth 3 | xargs-i{} Defaults write {} dvtplugincompatibilityuuids-array-add defaults read/applications/xcode.app/contents/info Dvtplugincompatibilityuuid sudo xcode-select--reset
Fourth step: Install Alcatraz.
Curl-fssl https://raw.github.com/supermarin/Alcatraz/master/Scripts/install.sh | sh
blue and white porcelain grab bag to prevent garbled
* jvmoptions:-dfile.encoding=utf-8
I. Swift and OC code mixing
using Swift in OC
* #import "occallswift-swift.h"
using OC files in Swift
* You must create a/= Configuration bridging file
HTTP request and Response Body Service Test library: http://httpbin.org/
///////////////////////////////////////4///////////////////////////////////////
first, the installation and use of Cocoapods:
1. Upgrade Gems first (can be omitted)
sudo gem update--system
2. Switch the cocoapods data source
"First Delete, then add, view"
gem sources--remove https://rubygems.org/
Gem sources-a https://ruby.taobao.org/
Gem Sources-l
3. Installing Cocoapods
sudo gem install cocoapods
or (e.g. 10.11 system) sudo gem install-n/usr/local/bin cocoapods
4. Setting up the Pod warehouse
pod Setup
5. Testing
"If there is a version number, the installation was successful"
pod--version
6.cocoapods Uninstall
sudo gem uninstall cocoapods
7. View Cocoapods Download Progress
CD ~/.cocoapods to this directory, use the DU-SH * command to view
8. Installation
pod Install--no-repo-update
pod Update--no-repo-update
9. Description
Platform:ios, ' 7.0 ' is used to set the minimum iOS version supported by all third-party libraries
pod ' sdwebimage ', ' ~>3.7.5 ' sets the frame name and version number
rule for version number:
' >1.0 ' can install any version above 1.0
' >=1.0 ' can install any version above or equal to 1.0
' <1.0 ' any version less than 1.0
' <=1.0 ' any version less than or equal to 1.0
' ~>0.1 ' any version above or equal to 0.1, but does not contain a version above 1.0
' ~>0 ' any version, equivalent to the non-specified version, by default the latest version number
10. General procedure after installing the framework using the Pod Install command:
01 Analysis Dependency: This step analyzes podfile to see dependencies between different class libraries. If more than one class library relies on the same class library, but relies on different versions, Cocoapods automatically sets a compatible version.
02 Download Dependency: Download the specified version of the class library to a local project, based on the results of the analysis dependency.
03 Build Pods Project: Create a Pods project that is designed to compile and manage third-party frameworks, Cocoapods will add the required frameworks, libraries, and so on to the project, and configure them accordingly.
04 Integration Pods Project: Integrate pods and projects into one workspace and set up file links.
Second, cocoapods command line update (install) step "Update"
$ sudo gem update--system//update gem First, domestic need to switch source
$ gem Sources--remove https://rubygems.org/
$ gem sources-a https://ruby.taobao.org/
$ gem sources-l
\*\*\* current SOURCES \*\*\*
https://ruby.taobao.org/
$ sudo gem install cocoapods//install Cocoapods
$ pod Setup
///////////////////////////////////////5///////////////////////////////////////
1. Change the Xcode template
2. Template file path:/applications/xcode-beta.app/contents/developer/library/xcode/templates/file Templates/Source/ Cocoa class.xctemplate/nsobjectobjective-c
. h file
/*
file name: ___filename___
Project name ___projectname___
Creator: Created by ___fullusername___
creation time: on ___date___.
Copyright: ___copyright___
Modify Person:
Modification Time:
*/
___importheader_cocoasubclass___
@interface ___filebasenameasidentifier___: ___variable_cocoasubclass___
@end
. m file
/*
file name: ___filename___
Project name: ___projectname___
Creator: Created by ___fullusername___
creation time: on ___date___.
Copyright: ___copyright___
Modify Person:
Modification Time:
*/
#import "___filebasename___.h"
@implementation ___filebasenameasidentifier___
@end
///////////////////////////////////////6///////////////////////////////////////
//load not to be rendered picture
+ (UIImage *) Imagewithoriginalrenderingmode: (NSString *) ImageName {
UIImage *image = [UIImage imagenamed:imagename];
return [Image imagewithrenderingmode:uiimagerenderingmodealwaysoriginal];
}
sudo launchctl unload-w
/system/library/launchdaemons/com.apple.discovryd.plist
sudo launchctl load-w
/system/library/launchdaemons/com.apple.discovryd.plist
Debug debug in PCH
#ifdef __objc__//OC file
#import "Uicolor+hex.h"
#import "Uiimage+tjimage.h"
#ifdef DEBUG/debug
#define TJLOG (...) NSLog (__va_args__)
#else//release
#define Tjlog (...)
#endif
#endif
///////////////////////////////////////7///////////////////////////////////////
1> Show hidden folders
# Show hidden files
$ defaults Write Com.apple.finder appleshowallfiles Yes && killall Finder
# do not show hidden files
$ defaults Write Com.apple.finder appleshowallfiles No && killall Finder
custom code block save path:
/users/tanjie/library/developer/xcode/userdata
To change the Xcode add-in:
/users/tanjie/library/developer/xcode/plug-ins/ksimagenamed.ideplugin/contents/resources/completions.plist
-FON-OBJ-ARC specifies that the. m file compilation mode does not use ARC compilation mode
-F-OBJ-ARC specifies that the. m file uses Arc compilation mode
closed. Ds_store:sudo Find/-name ". Ds_store "-depth-exec rm{}\;
COMMAND + B:
compile the code. We write a time code, compile it first, and see if there are any grammatical errors, which is a good habit. In fact, in the process of Xcode running the project, through a few stages, compiled---link, build target file, execute.
Decompression tool: Betterzip
GitHub user name: tj812215542
Markdown Piecemeal Finishing