For example, I wrote
const NSString* firstString = @”xxx”;
NSString* secondString = @”yyy”;
The sending ‘const nsstring *’ to parameter of type ‘nsstring *’ discards qualifiers warning appears.
Set const nsstring * firststring = @ “XXX”;
Change to nsstring * const firststring = @ “XXX”;
Explanation: the former means that the pointer itself is not modifiable, while the latter means that the content pointed to by the pointer is not modifiable. Both functions are to make the firststring only readable and not writable.
- Sending ‘const NSString *’ to parameter of type ‘NSString *’ discards qualifiers [Solved]
- [Solved] Compilation error: dereferencing pointer to incomplete type…
- Visual Studio 2012 error C4996: ‘scanf’: This function or variable may be unsafe.
- Solution for Visual Studio 2012 compilation error [error C4996:’scanf’: This function or variable may be unsafe.]
- Common problems and solutions for CheckStyle errors
- [Go] Solve panic: runtime error: invalid memory address or nil pointer dereference in golang
- No match for ‘operator =’ both ends of the equal sign do not match
- Redis installation error: jemalloc/jemalloc.h: No such file or directory.
- How to Solve error: command ‘C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.0\bin\nvcc.exe‘ failed
- How to Fix error: conversion from “” to non-scalar type “”
- Vue: How to Solve Error uncaught (in promise) cancel
- Error: array bound is not an integer constant before ‘]’ token
- MOTR compiling error: cannot call member function ‘void std::basic_string＜_CharT, _Traits, _Alloc＞::_R
- Solve the problem of incorrect display of dialogfragment width
- React Hook “useState“ is called in function “xxx“ which is neither a React function component or
- Libtorch Error: Expected object of type Variable but found type CUDALongType for argument #2 ‘index’
- [Solved] Warning: using directive refers to implicitly-defined namespace ‘std’
- QT solves error: use of deleted function and is private within this context
- Angularjs1 exception error:[$injector:unpr]