ios development problem record in 2022

1.ld: warning: Could not find or use auto-linked framework ‘xxxFramework‘ Undefined symbols【别人】

Reason: The SDK framework used references another A framework. Although they are both static libraries, when the SDK is introduced, the A framework must also be introduced. Otherwise there will be this warning and the reported symbol does not exist.

2.C++ + #include<memory> smart pointer prompt....usr/include/c++/v1/__threading_support:457:11: error build: Use of undeclared identifier 'nanosleep'. 【other people】

Reason: header search paths introduce the FFmpeg header file, one of which is named time.h, and nanosleep comes from the header file /usr/include/time.h, causing a conflict, causing the system to crash when compiling and searching for the header file. Header file is overwritten.

3. Dynamic and static library nesting problem: https://www.jianshu.com/p/b03d617917d6 [Others]

 4.xcode14 ios 15.7 device connection xcode prompts "Failed to prepare device for development". Reason: Although xcode 14 includes device support for iOS16, it does not include device support for 15.7. 【Own】

5.LEEAlert cannot be popped up if it is not written in a chain. 【Own】

写了一个类方法,方法里的代码如下。

// 这里获取了一下config的对象
LEEBaseConfigModel *config = [LEEAlert alert].config;
    config.LeeAddTitle(^(UILabel * _Nonnull label) {
        label.text = @"123123";
        label.textColor = UIColor.titleDarkColor;
        label.font = [UIFont systemFontOfSize:15];
    }).LeeAddContent(^(UILabel * _Nonnull label) {
        label.text = @"123123";
        label.font = [UIFont systemFontOfSize:15];
        label.textColor = UIColor.titleColor;
    }).LeeAddAction(^(LEEAction * _Nonnull action) {
        action.title = @"123123";
    }).LeeAddAction(^(LEEAction * _Nonnull action) {
        action.title = @"123123";
    }).LeeShow();

The reason is that when the product is compiled, the local variables hold the properties of the temporary object, which will be released because the temporary object is released immediately, causing the pop-up window to be invalid. The strange thing is that when develop is compiled, the release does not happen immediately, resulting in a successful pop-up window. The solution is to hold [LEEAlert alert] in a local variable.

6.SSL pinning needs to obtain the validity period of the cer certificate, so OpenSSL is used to parse the certificate. There happened to be a static library of OpenSSL in the project, but I didn’t know the version number, so I downloaded the 1.1.1 header file. It is found that the serial number can be obtained, but the version number is -1, and the time returned by X509_get_notAfter is null. Download a compiled library and header file, make a demo project and find that the time can be obtained, so it is determined that the problem is caused by inconsistent header file versions. Use IDA to obtain the static library version number 1.0.2h, and introduce the header file of this version into the project. Because the version is older, it prompts that some functions do not exist. After replacement, the effective time is successfully obtained. 【Own】

7.NSDictionary cannot read the plist file corresponding to NSUserDefaults, and the result is empty. Reason: NSUserDefaults is stored in bplist form, not xml form. Smaller files can be obtained, but the NSDictionary API cannot read them. 【Own】

8. Text reading AVSpeechSynthesizer prompts Query for com.apple.MobileAsset.VoiceServices.VoiceResources failed: 2. Reason: The system is muted. Solution: Activate the audio session and set the category to AVAudioSessionCategoryPlayback.

Guess you like

Origin blog.csdn.net/Mamong/article/details/127043205