Summarizes a variety of small problems

1: Xcode project file out of sequence
selected folder, right -> the Sort by name (by the Sort of the type)
2. Compile error: Illegal redeclaration of property in class extension 'XXXXTableViewCell' (attribute must be 'readwrite', while its primary must be 'readonly')
because we repeat the attribute was declared,
solution:
delete the .h or .m file excess property to
3. compile error Layout Guide the before iOS Area Safe 9.0 [12]
XCode9 cited above new features the function Safe Area, the characteristics of the system iOS9.0 or less does not support
the properties into a future system 9.0, the correct approach is as follows
Here Insert Picture Description
Builds for selected by default deployment target xcode's, Sage Area special effects are not supported under 9, so change to 9.0 above, when using this app under xib than 9.0, Xcode can be deployed without problems,
4. knowledge set: semaphore (dispatch_semaphore_signal)
dispatch_semaphore_wait in which the thread, which thread to become blocked

//crate的value表示,最多几个资源可访问

    dispatch_semaphore_t semaphore = dispatch_semaphore_create(0);
    dispatch_queue_t quene = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0);
    //任务1
    dispatch_async(quene, ^{
        NSLog(@"zhouzhou -- run task 1");
        sleep(5);
        NSLog(@"zhouzhou -- complete task 1");
        dispatch_semaphore_signal(semaphore);
    });
    dispatch_semaphore_wait(semaphore, DISPATCH_TIME_FOREVER);
    NSLog(@"zhouzhou -- all complete return");

5. Knowledge Points: monitor task completion (dispatch_group_notify)

dispatch_queue_t queue = dispatch_get_main_queue();//dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0);
    dispatch_group_t group = dispatch_group_create();
    dispatch_group_enter(group);
    dispatch_group_async(group, queue, ^{

    });
    
    dispatch_group_notify(group, queue, ^{
        
    });

6. Knowledge Points: After the high moral map click on the compass indicating the direction of the fixed (not turn) problem
Here Insert Picture Description
Cause: When you click on the compass picture, will go this way at this time has become a discovery mode MAUserTrackingModeFollow, then set it back mobile phone direction indicated on the right
6. edit given: Support Files / Pods-xx / Pods-xx.debug.xcconfig: unable to open file (in target "xx" in project "xx") (in target 'xx')

Solve: pod install (7,8,9 may encounter errors, read on)

7.控制台报错:执行 pod install报错RuntimeError - [!] Xcodeproj doesn’t know about the following attributes {“inputFileListPaths”=>[], “outputFileListPaths”=>[]} for the ‘PBXShellScriptBuildPhase’ isa.

Solve: gem update xcodeproj

8.控制台报错:执行 gem update xcodeproj报错Updating installed gems
ERROR: While executing gem … (Gem::RemoteFetcher::FetchError)
bad response Not Found 404 (https://gems.ruby-china.org/specs.4.8.gz)

原因:服务域名更换公告. 因域名备案问题, .org 域名无法继续提供RubyGems 镜像服务,我们提供 .com 代替 .org 的域名,其他一切不变!! 详情访问.
解决:

gem sources --remove https://gems.ruby-china.org/
gem sources -a https://gems.ruby-china.com
gem sources -l

如果输出:

*** CURRENT SOURCES ***
https://gems.ruby-china.com

表示正确了

9.控制台报错:执行 gem update xcodeproj报错Updating installed gems
Updating xcodeproj
Fetching: nanaimo-0.2.6.gem (100%)
ERROR: While executing gem … (Gem::FilePermissionError)
You don’t have write permissions for the /Library/Ruby/Gems/2.3.0 directory.

解决:sudo gem update xcodeproj
10.控制台报错:执行 sudo gem update --system报错YAML safe loading is not available. Please upgrade psych to a version that supports safe loading (>= 2.0).
ERROR: SSL verification error at depth 1: unable to get local issuer certificate (20)
ERROR: You must add /O=Digital Signature Trust Co./CN=DST Root CA X3 to your local trusted store
Updating rubygems-update
ERROR: While executing gem … (Errno::EPERM)
Operation not permitted - /usr/bin/update_rubygems

解决:sudo gem update -n /usr/local/bin --system
11.控制台报错:执行 pod install报错You have either:
out-of-date source repos which you can update with pod repo update or with pod install --repo-update.
mistyped the name or version.
not added the source repo that hosts the Podspec to your Podfile.
Note: as of CocoaPods 1.0, pod repo update does not happen on pod install by default.

解决:sudo gem update -n /usr/local/bin --system

12.控制台报错:执行 pod search AFNetworking报错[!] Unable to find a pod with name, author, summary, or description matching AFNetworking
解决:rm ~/Library/Caches/CocoaPods/search_index.json
13.控制台报错:执行 pod install报错[!]/Library/Ruby/Site/2.0.0/rubygems.rb:289:in find_spec_for_exe: can’t find gem cocoapods (>= 0.a) with executable pod (Gem::GemNotFoundException)
from /Library/Ruby/Site/2.0.0/rubygems.rb:308:in activate_bin_path
from /usr/local/bin/pod:23:in

解决:udo gem install -n /usr/local/bin cocoapods
14.Xcode10.2不再支持swfit3.0问题:or: SWIFT_VERSION 3.0 is unsupported, supported versions are: 4.0, 4.2, 5.0. (in target ) 和 No visible @interface for declares the selector 问题
Target->Build Setting 搜索swift 找到swift Language Version选择支持的版本,我这里选的是5
Here Insert Picture Description
此时调用swift方法依然会报错说:
No visible @interface for 'ToolView' declares the selector 'initWithFrame: style: onClicked:'
again in front of the swift on the method of adding @objc
Here Insert Picture Description

Published 40 original articles · won praise 10 · views 30000 +

Guess you like

Origin blog.csdn.net/ai_pple/article/details/87930337