Error reported in Xcode: unknown attribute ‘observableobject’
Error reason:
@ObservableObject var vm: ViewModel = ViewModel()
Modify to the below:
@ObservedObject private var vm: ViewModel = ViewModel()
Error reported in Xcode: unknown attribute ‘observableobject’
Error reason:
@ObservableObject var vm: ViewModel = ViewModel()
Modify to the below:
@ObservedObject private var vm: ViewModel = ViewModel()
environment
Xcode13. 2 the first project created is set. The minimum version of IOS is 15.2, which has been compiled several times. The minimum IOS version of the switching project is IOS 10.0 After 0, the following errors appear:
error: Command MergeSwiftModule failed with a nonzero exit code
Solution:
Method 1: clean (Command + Shift + k)
Method 2: Change (Project -> target -> builfsetting -> compilation mode -> debug -> switch to whole module) (but this may slow down subsequent compilation)
Reason: This is because your version of Xcode does not match the version of cocoapods. You need to update your cocoapods
Solution: enter the command $gem install cocoapods -- pre
Then execute pod install again.
The boss told me that this is the problem that M1 may encounter, but I’m not M1, and I haven’t updated the system!!! Hahaha, fuck
these two pits are encountered
x 'require': incompatible library version........ (LoadError)
cannot load such file -- 3.0/ffi_c (LoadError)
Screenshot above
when these two pits are encountered. Baidu, there are few online solutions, and the cocoapods are deleted and retried. It’s useless
finally, read the tips carefully!! Let’s enter
gem pristine executable - hooks -- version 1.6.1
but we still can’t
finally, we found it was input 👆 This command has insufficient permissions
you can reuse cocoapods by adding sudo
before this command, and pod install is normal. The correct command is as follows
sudo gem pristine executable - hooks -- version 1.6.1
Error:
[!] Error installing DoubleConversion
[!] /usr/bin/git clone https://github.com/google/double-conversion.git /var/folders/_h/xtz7k0td2vv6r1hq9jswkyx40000gn/T/d20211021-51746-zrhmvm –template= –single-branch –depth 1 –branch v1.1.6
Cloning into ‘/var/folders/_h/xtz7k0td2vv6r1hq9jswkyx40000gn/T/d20211021-51746-zrhmvm’…
fatal: unable to access ‘https://github.com/google/double-conversion.git/’: LibreSSL SSL_connect: SSL_ERROR_SYSCALL in connection to github.com:443
Solution:
git config --global --add remote.origin.proxy ""
If the above method doesn’t work
Find ways to improve the network and use mobile phone hotspots
take a look at pod install several times
Error reporting and resolution of #selector above swift5
The version of swift has changed a lot recently. If you add an event to a button, you must be very skilled in OC. How do you define functions and pass parameters in
swift
let btn = UIButton()
btn.tag = 2
btn.addTarget(self, action: #selector(buttonClick(button:)), for: .touchUpInside)
@objc func buttonClick(button: UIButton) {
button.isSelected = true
print(btn.tag!)
print("\(btn.tag)")
}
The custom method must be preceded by @ objc to follow the OC mechanism, otherwise an error will be reported
Problem Description:
the OS X application cannot access the network request. After timeout, an error is reported: http load failed, 0/0 bytes (error code: – 1003 [10: – 72000])
Reason:
sandbox configuration error
Solution:
first confirm whether the HTTPS access policy is enabled for the project, then find the “. Entitlements” file generated by default, and set the app sandbox value to false. Of course, apple stipulates that the sandbox policy must be enabled for the app store on the shelf, so it can target – & gt; Signing& Find the options in capabilities as shown in the figure below and enable them
Recently, an error was reported when submitting the audit package: app store connect operation error.
You must be an Admin or Technical user in order to deliver content or metada.(1070)
Screenshot of error report:
Solution: use the transporter tool to upload, once OK. (I tried other methods in the middle, but I won’t talk about them one by one. I successfully uploaded this method, and the transporter tool can be found in the app store. Good luck to you.).
report errors:
Error: abort trap: 6 when using the third party framework of Gaode map in swift project
resolvent:
In project settings, select build settings – & gt; swift compiler – code generation – & gt; optimization level
Set the optimization level to optimize for size [- osize]
Xcode will continue when iPhone is finished.
There are three reasons for the pop-up interface as shown in the figure below:
first
First mobile connection to Xcode
second
After updating the mobile phone system, connect to Xcode for the first time
third
After updating Xcode, connect your phone for the first time
Snip20170606_ 2.png
Solution:
can only wait.
Connect your cell phone and wait. It will be OK in a moment.
Author: dull and shy
Link: https://www.jianshu.com/p/0e21b4cf7897
Source: Jianshu
The copyright belongs to the author. For commercial reprint, please contact the author for authorization. For non-commercial reprint, please indicate the source.
Xcode error:
Could not launch “” Domain: IDEDebugSessionErrorDomain Code: 3 Failure Rea
before test has been on the iPhone, after changed the error as above.
Reason:
did not trust its own description management account when debugging a new device for the first time.
The solution:
in the description of the management and trust his account.
let testString =”lalala”
Let a = testString. ToInt ();
Println (” \ (a! “)
You cannot unpackage an empty Optional, otherwise a runtime error will be reported. Therefore, it should be determined whether it is null before unpacking Optional.
Correct writing:
let testString =”lalala”
Let a = testString. ToInt ();
If (a! = nil) {
Println (” \ (a! “)
}