Tag Archives: ios

IOS app connect error store submitted for review

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.).

IOS error: linker command failed with exit code 1 solution

The error is as follows:

ld: library not found for -lXXX

clang: error: linker command failed with exit code 1 (use -v to see invocati

When we refer to static libraries, we do not configure library search paths, which results in an error


Build settings – library search paths view the path of the XXX file. If the path is wrong or there is no path, add the correct path again, and then compile Xcode.

Ambiguous reference to member ‘dataTask(with:completionHandler:)’

Ambiguous reference to member ‘dataTask(with:completionHandler:)’
let request = NSMutableURLRequest(url: URL(string: “Your API URL here” ,param: param))!,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval:”Your request timeout time in Seconds”)
request.httpMethod = “POST”
request.allHTTPHeaderFields = headers as? [String : String]
let dataTask = URLSession.shared.dataTask(with: request ) {data,response,error in
let httpResponse = response as? HTTPURLResponse

    if (error != nil) {
     } else {

    DispatchQueue.main.async {
       //Update UI here


Solution: just make request as URLRequest
let dataTask = URLSession.shared.dataTask(with: request as URLRequest)

[solution] LD: warning: directory not found for option

In the process of IOS development, this problem is easy to be confused. Let’s have a break today.

Problems and Solutions

In short, there are two aspects to this problem.

The error is as follows, which means that it is an exception when querying Library .

"directory not found for option '-L/..."


Project – & gt; targets – & gt; build setting – & gt; library search paths

Delete the path inside

The error is as follows, which means that it is an exception when querying framework .

"directory not found for option '-F/..."


Project – & gt; targets – & gt; build setting – & gt; framework search paths

Delete the path inside

OK, it’s done.

The above problems have been solved. If you want to know more, you can continue to look down.


Briefly speaking, library search paths and framework search paths .

Framework Search Paths

The explanation that can be found in official documents is as follows:

Locating Frameworks in Non-Standard Directories

If your project links to frameworks that are not included in any of the standard locations, you must explicitly specify the location of that framework before Xcode can locate its header files. To specify the location of such a framework, add the directory containing the framework to the “Framework Search Paths” option of your Xcode project. Xcode passes this list of directories to the compiler and linker, which both use the list to search for the framework resources.

Note: The standard locations for frameworks are the /System/Library/Frameworks directory and the /Library/Frameworks directory on the local system.

If the frameworks you refer to are not in standard locations, you need to set “framework search paths” in the configuration file of the project to specify search paths for compilers and linkers.

Library Search Paths

As for “library search paths”, there is no decent official document, but the content should be similar, but one is used to search framework , and the other is used to search Library .

Although it is said that, what is library and what is framework are still very vague.

However, we found some blogs to illustrate this problem, which are quoted below.


Search paths settings in IOS development

In the development of IOS, we often encounter some path settings, such as the introduction of Baidu map SDK, copying projects to other computers, or reporting the error of library not found when multiple people develop at the same time, or introducing a third-party library, such as asihttprequest / retableview often reporting ? Include & lt; & gt; error, so we need to configure some search paths.

Framework/Library Search Paths

1、Framework Search Paths

The search path of the framework (. Framework bundles ) attached to the project is not widely used in IOS development. Generally, the framework built in the system is used for IOS development.

2、Library Search Paths

Xcode will automatically set the search path of the. A file to be dragged to the third-party library (. A files ) in the project. In order to facilitate transplantation or multi person collaborative development, it will usually be manually set.

For example, we will set the SDK of Baidu map as follows:

$(SRCROOT)/../libs/Release$(EFFECTIVE_ PLATFORM_ Name) , where $(srcroot) macro represents your project file directory, $(effective) _ PLATFORM_ Name) macro represents whether the current configuration is OS or simulator

Header Search Path

1. C / C + + header file reference

In C / C + +, include is a mutation instruction. When compiling, the compiler will replace the relative path with the absolute path. Therefore, the absolute path of the header file is equal to the search path + relative path.

(1) ? Include & lt; iostream. H & gt; : refers to the header file under the compiler’s class library path

(2) ? Include "hello. H" : the header file that refers to the relative path of the project directory

2、(User) Header Search Path

(1) header search path refers to the search path of the header file.

(2) User header search paths refers to the search path of user-defined header files

3、Always Search User Paths

If always search user paths is set to Yes , the compiler will first search the path configured by User header search paths . In this case, ? Include & lt; string. H & gt; , User header search paths the files under the search directory will cover the header files of the system.

reference material

    search paths settings in IOS development, IOS: clarify different search paths, IOS developer Library – including frameworks

[problem record] objc_ Too many arguments to function call

Objc_msgSend can be used with arguments before Xcode 6. Too many arguments to function call after Xcode 6. ;
The solution

Build Settings -> Enable Strict Checking of objc_msgSend Calls to NO.

this method fails in Xcode 12.
2, Through type casting

((void (*)(id, SEL, id))objc_msgSend)(target, sel, value);

The number of parameters to be passed is self-defined

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.
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.

Common problems and basic concept knowledge of OpenGL

OpenGL FAQ and basic concept knowledge (continuously updated!!)
1. The concept of matrix in OpenGL, what is Model,View,Project?
We know the World in the OpenGL Matrix (World Matrix)/View Matrix (the View Matrix and Projection Matrix (the Projection matirx)
in the Model: the Matrix determine the World coordinates of a unified, mainly aimed at the Model of translation, rotation, scaling, shear, and other functions, is the Model from local space into World space.

Projection matrix is the part of the scene that we can see, with the camera/observer position and so on (set mouse movement, scroll wheel, etc.), and converts all world coordinates to View coordinates.
2. Scheduling between CPU and GPU in OpenGL

OpenGL program involves two types of processing unit CPU and GPU.
engl main program has CPU call to run, image processing part through GLSL to GPU execution.
Data transfer between CPU and GPU is divided into three steps:
1. First use the built-in OpenGL function to generate an ID number
2. According to the need for the ID number of memory types of binding, binding to be used in the receiving system after the completion of the GPU memory of the data in the “identifier” will be ready,
3. This part of memory is initialized. The initialized content is from the system memory, and this part of function is completed by the glBufferData function. After the data is submitted to the GPU dedicated memory, it is necessary to allocate the data according to the application scenarios, such as some data as vertices, some as colors, some for illumination control and so on
In addition, due to the high parallel structure of GPUs, all GPUs have high computational efficiency in processing graphics and complex algorithms. Most of the CPU area is controllers and registers, while GPUs have more ALUs, logical operational units for data processing, rather than data caching and flow control.
The concept of buffers in OpenGL
[1] Frame Buffer: A frame buffer is a combination of the following buffers. Using frame buffers allows you to render your scene into a different frame buffer, which allows you to create mirrors in the scene, or create cool effects that store data for the display.
[2] Color Buffer: Stores the color of all fragments: that is, the effect of visual output.
[3] Depth Buffer: determines which facets are occluded according to the Z value of the buffer. Automatically generated by GLFW.
[4] stencil buffer: Similar to depth testing, the template value is compared to the default value to determine whether to discard the fragment.
Data is processed in OpenGL in the following order: vertex shader – fragment shader – template test – depth test
The concept of depth testing
1. What is depth?

OpenGL will have a special area for storing Z value (the Z value on each pixel), which is the depth cache.
2. Depth Buffer Function?
In general, when we draw a graph, the later drawing overrides the previous graph, and the general drawing order is drawn from the back to the front. So there is a performance problem with the “covered part”, where the first part is covered, and all you see is the top part of the module and the bottom part of the covered part is not meaningful!
depth test appears to solve the covering problem
nction: when the depth test is turned on, the Z value will be checked. The same area close to the observer will be drawn, and other covered areas will not be drawn, regardless of the order of drawing.
3. How to use the deep cache test?

enable (GL_DEPTH_TEST);
in the above code open depth test by default, the Z value under the condition of small will be overwritten
If the observer is in the positive direction of the Z axis, the Z value is close to the observer
If the observer is in the negative direction of the z-axis, the smaller z-value is closer to the observer

How to solve the conflict problem caused by the same depth value (same Z value)?
The first method: in the second drawing the same Z value, the tiny offset cover problems
note: must be very careful to ensure that the Z value of the gap, or like a refrigerator on the refrigerator as suspended risk
The second method is to sample the GLPolygonOffset function so that the depth value of the fragment can be adjusted so that the depth value is offset without creating a suspended emphasis

2016.11.1 OpenGL learning, black screen does not display graphics

The reason for looking for an afternoon: the original sentence
In SWIFT2, the sizeof method is replaced with the memoryLayout method. The memoryLayout. Size (ofValue: vertices) retrieves only one of the vertices in the array, so it needs to be multiplied by the number. GlBufferData (GLenum(GL_ARRAY_BUFFER), memorylayout.size (ofValue: vertices)*6, vertices, GLenum(GL_STATIC_DRAW))

After IOS upgrade, the time control selected by the wheel will be invalid, uidatepicker

    2. If the previous style is used


datepicker.preferredDatePickerStyle = .wheels
    I don’t know if apple’s bug is wrong in both width and height


let datepicker = UIDatePicker(frame: CGRect(x: 0, y: 100, width: self.view.frame.width, height: 300))
 datepicker.preferredDatePickerStyle = .wheels  
 datepicker.backgroundColor = UIColor.yellow    
 datepicker.datePickerMode = .dateAndTime    

4. To fix this, set the frame after the datePickerMode and set it to normal

override init(frame: CGRect) {
        super.init(frame: frame)
        backgroundColor = .white

C / C + + rounding function ceil(), floor ()

#include <math.h>
double floor(double 

float floorf(float x); 
long double floorl(long double x);

double floor(double x);
double ceil(double x);

USES the floor function. Floor (x) returns the largest integer less than or equal to x.
such as: floor ten floor (10.5) = = = = (10.5) – 11

USES the ceil function. Ceil (x) returns the smallest integer greater than x.
for example: ceil(10.5) == 11 ceil(-10.5) ==-10

floor() is rounded to negative infinity, floor(-10.5) == -11;
ceil() is rounded to positive infinity, and ceil(-10.5) == -10

(ceil()) (floor) (floor)

1. /
//Test “/”
cout & lt; < “Test \”/\”!” < < endl;
cout & lt; < “7/2 =” < < 7/2 < < endl;// 3
cout & lt; < “7/2.0 =” < < 7/2.0 & lt; < endl;// 3.5
cout & lt; < “7.0/2 =” < < 7.0/2 & lt; < endl;// 3.5
cout & lt; < “7.0/2.0 =” < < 7.0/2.0 & lt; < endl;// 3.5
cout & lt; < “7/3 =” < < 7/3 < < endl;// 2
cout & lt; < endl;
2. %
//Test “%”
cout < < “Test \”%\”!” < < endl;
cout & lt; < 9%3 = “< < 9%3 < < endl;// 0
cout & lt; < “9%4 = “< < 9%4 < < endl; 1
//// cout & lt; < “9.0% 3 =” < < 9.0% 3 & lt; < endl;
// cout & lt; < 9%3.0 = “< < 9% 3.0 & lt; < endl;
cout & lt; < endl;
3. Round
//Test round()
cout < < “Test \” Round \”!” < < endl;
double dRoundA = 1.4;
double dRoundB = 1.6;
double dRoundLowA = -1.4;
double dRoundLowB = -1.6;
double dRoundLowC = 0.0;
cout & lt; < dRoundA < < ” = ” < < RoundEx(dRoundA) < < endl;// 1
cout & lt; < dRoundB < < ” = ” < < RoundEx(dRoundB) < < endl;// 2
cout & lt; < dRoundLowA < < ” = ” < < RoundEx(dRoundLowA) < < endl;// – 1
cout & lt; < dRoundLowB < < ” = ” < < RoundEx(dRoundLowB) < < endl;// – 2
cout & lt; < dRoundLowC < < ” = ” < < RoundEx(dRoundLowC) < < endl;// 0
cout & lt; < endl;
double RoundEx(const double&
double dIn = dInput;
if (dInput & gt; = 0.0)//???
return int(dIn + 0.5);

} else
return int (dIn 0.5);

4. The ceil () take up the whole
// Test ceil () take up the whole
cout & lt; < “Test ceil() round up!” < < endl;
cout & lt; < “Ceil 1.2 =” < < The ceil (1.2) & lt; < endl;// 2
cout & lt; < “Ceil 1.8 =” < < The ceil (1.8) & lt; < endl;// 2
cout & lt; < “Ceil-1.2 =” < < The ceil (1.2) & lt; < endl;// – 1
cout & lt; < “Eil-1.8 =” < < The ceil (1.8) & lt; < endl;// – 1
cout & lt; < “Ceil 0.0 =” < < The ceil (0.0) & lt; < endl;// 0
cout & lt; < endl;
5. Floor () the whole
/down/Test floor () the whole down
cout & lt; < “Test floor() down full!” < < endl;
cout & lt; < “Floor 1.2 =” & LT; < Floor (1.2) & lt; < endl;// 1
cout & lt; < “Floor 1.8 =” < < Floor (1.8) & lt; < endl;// 1
cout & lt; < “Floor -1.2 =” < < Floor (1.2) & lt; < endl;// – 2
cout & lt; < “Floor -1.8 =” < < Floor (1.8) & lt; < endl;// – 2
cout & lt; < “Floor 0.0 =” < < Floor (0.0) & lt; < endl;// 0
cout & lt; < endl;

Summary of IOS storyboard unwind segues

When using storyboard development, we often add a button on a scene, drag the button to the page we want to associate with, and finally choose push to jump. So scene_A and scene_B have a “sequence” jump. But sometimes, you want to trigger an action from scene_B to jump back to scene_A. If you do it the same way you did it, you’re going to have a problem. Because the scene_a that jumps back is not the scene_a that it was. So we’re going to have to use the unwind segue to our storyboard. Write a little summary of the demo:
Create the storyboard shown in the figure below. RedViewController pushes to YellowViewController, YellowViewController pushes to BlueViewController, and BlueViewController modal to GreenViewController. You can return RedViewController from YellowViewController and YellowViewController and RedViewController from BlueViewController. Of course, you can also go back to the BlueViewController from GreenViewController.

Back to the code. Since storyboard is used, the jump of push and model saves writing code, similarly, the jump of “return” also saves code.
RedViewController. M

– (IBAction)unwindSegueToRedViewController:(UIStoryboardSegue *)segue {
It’s important to note that the return value of this method must be an ibaction, and the argument must be a uistoryboardsegue. As for why, the following code will show.
Go back to your storyboard file and observe that the RedViewController scene has a green button below it (not because you wrote the code above, but because it’s always there).

Next, right click the exit button (green button), will appear just write method unwindseguetoredviewcontroller:

Select this method and drag and drop to the Back RedVC button on the YellowViewController.

After letting go, an Action prompt appears near Back RedVC and is selected. In this way, when you click the Back Red VC button on the YellowViewController, it will jump back to the Red View Controller. Let me compile it. There’s no problem with insurance. Run the program.
Instructions required:
1. If you like from yellowviewcontroller returns to redviewcontroller, then unwind segue associated methods must be stated in redviewcontroller again, that is the example of – (inaction) unwindtoredviewcontroller (segue uistoryboardsegue *); Note the parameters and return points, and the method name is arbitrary.
2. Right click on the exit button of redviewcontroller (green button) to show the method that unwind segue can associate with, and then go to the button of yellowviewcontroller.

Similarly, the BlueViewController can be returned to the Implementation of The YellowViewController.
In YellowViewoController. M

– (IBAction)unwindToYellowViewController:(UIStoryboardSegue *)segue {
Right-click the Exit button of The YellowViewController to associate BlueviewControler’s Back YellowVC button.
Also need to realize from the immediate return to redviewcontroller blueviewcontroller, selected redviewcontroller exit button, select the button on the blueviewcontroller unwindtoredviewcontroller associated.
Compile it, no problem, run it, get a feel for it.
Either the YellowViewController or the BlueViewController can be returned to the RedViewController, at which point you need to make a judgment to see where the return is coming from.

- (IBAction)unwindSegueToRedViewController:(UIStoryboardSegue *)segue {
    UIViewController *sourceViewController = segue.sourceViewController;
    if ([sourceViewController isKindOfClass:[YellowViewController class]]) {
        NSLog(@"from yellow vc");
    else if ([sourceViewController isKindOfClass:[BlueViewController class]]) {
        NSLog(@"from blue vc");

And that’s why the argument to a method is a segue, where you get the source View Controller.

Now when you try push, the same thing with modal, you present the GreenViewController from the BlueviewController in modal mode.
To return, you need to write the method associated with the unwind segue in the BlueviewController:

– (IBAction)unwindToBlueViewController:(UIStoryboardSegue *)segue {
Associated unwindtoblueviewcontroller methods on the corresponding button.
At this point, I’m done with “back” in my storyboard, and I spend most of my time dragging and dropping controls without writing the relevant pop dismiss method at all. That’s one of the strengths of storyboard.
Is it possible to implement it in code?You can.
Select GreenViewController Scene in your storyboard, and on the left you can see the representation of the unwind segue, kind of like the DNA sequence yes, once you select it, the only representation that defines it is the greenUnwind

In greenviewcontroller. M
Method associated with back Code button:

- (IBAction)backCodeBtnTapped:(id)sender {

    [self performSegueWithIdentifier:@"greenUnwind" sender:self];

Compile, there are no errors, the program.

Program all code.