Tag Archives: xcode

Sending ‘const NSString *__strong‘ to parameter of type ‘NSString *‘ discards qualifiers

String value encountered a warning message, record it

Sending 'const NSString *__strong' to parameter of type 'NSString *' discards qualifiers

The code is written like this

UIKIT_EXTERN const NSString * kNetworkType;

This warning will be issued when using it, and it will be changed to:

UIKIT_EXTERN NSString * const kNetworkType;

If const is placed after nsstring *, there will be no warning.

IOS warning – this block declaration is not a prototype

About warnings

We define a block without parameters, usually in the following way

one

typedefvoid (^UpdateSwichBtnBlock)();

A warning is prompted in xcode9

one

two

This block declaration 

is 

not a prototype

Insert ‘

void

'

The solutions can be as follows

one

typedefvoid (^UpdateSwichBtnBlock)(

void

);

But in this way, many third parties need to change, the scope involved is too large, it may not be suitable at present, although this is the trend

Or, if it’s only a few places, it can be used

one

two

three

four

#pragma clang diagnostic push

#pragma clang diagnostic ignored 

"-Wstrict-prototypes"

typedefvoid (^UpdateSwichBtnBlock)();

#pragma clang diagnostic pop

A complete temporary solution to all such warnings

In the setting of the project

Set to no, the warnings disappear

However, this is not a good habit. It’s just a temporary way not to prompt this type of warning

Could not launch “” Domain: IDEDebugSessionErrorDomain Code: 3 Failure Rea

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.

Unable to find utility “instruments”, not a developer tool or in PATH

An error occurred while debugging a project on ios

unable to find utility “instruments”, not a developer tool or in PATH

error cause:

The default version
is not set when xcode has been upgraded or when multiple versions of xcode coexist

solution:

Open up Xcode and select

Go to Locations, and select the version you want to use in Command Line Tools

At this point, exit Xcode completely and try run-ios again. Everything is ok!

MacOS Catalina (system): xcrun: error: invalid active developer path(), missing xcrun at / Library

Question why
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
A scenario
git
SVN is not working properly
Idea suggests that the SVN path is not correct
The solution
Open the command terminal to run

xcode-select --install

After entering, the system will pop up and download the Xcode component. Click “Ok” and the download will be completed.
xcode-select: note: install requested for command line developer tools
Problem analysis
At first, I thought the SVN path was incorrect, but it was correct after repeated confirmation.
If you think SVN is gone, consider the MAC’s own Subversion can’t go wrong.
Finally, In SVN — Version, I was given an error notification prompt:
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
And Then I Command C, Command V, and I open Baidu, and I do it all at once.
The problem summary
A lot of Mac software relies on xcode’s precursors.

Copy Xcode project encountered MAC error code – 8058 (error code – 8058)

This morning, I opened the computer and routinely copied a copy of the program backup, but I encountered 8058 error. I tried to restart the computer, modify the folder permissions and change back, but all of them were invalid.
Thank you for the operation-can-t-be-completed-because-an-unexpected -error-error-COD problem. I was very upset when I saw that the number of answers was 0. I found that the problem was solved in the main building = W =.
Xcode is added to the project file, can add it to a folder itself, although this will prompt the item of the same name already exists in the engineering, operation fails, will not be shown in engineering, but in fact in the folder copy has been completed, and formed a recursive folder, can point to open. It’s fun, but you can’t replicate it… Go to this folder and delete it. 8058 error is resolved.

In IOS development, there is an error: Apple mach-o linker error

Small make up in a small demo letter about ring, ring of import letter SDK (EaseMobSDK), the connection of the error, as shown in the figure below:

solution is in general, the following figure, respectively, in the absence of label arrow to add compiler needs. M files and the necessary framework:

and the small make up the problem here is not more than compile files and framework problem, the solution is,

in the third arrow to add: -obJC, and then you just recompile.

didFailWithError: Error Domain=kCLErrorDomain Code=0 “The operation couldn’t be completed. (kCLError

I believe that many people have encountered this problem, the Internet is also by a variety of answers which this calculate more comprehensive
The reason for the error is the project — &gt in Xcode; The scheme – & gt; Edit scheme – & gt; The options – & gt; The core location – & gt; Error allowing location simulation;
solutions:

    if it is already set, uncheck it and save it; The simulator – & gt; Reset content and Settings: re-check allow location simulation, then reset content and Settings

Most people should have solved the problem, but I didn’t… And the solution is this

It’s not because I’m in Hong Kong. It’s because there’s only one Chinese in Hong Kong.
will not report an error after it is set. In fact, it is to specify the position of the simulator. I don’t know why the simulator cannot be automatically positioned, so I can test with the real machine

Learn iOS, he is enough, small code brother video, wisdom, dark horse, all kinds of Swift books