Common Error Analysis in xCode

Source: Internet
Author: User

Common Error Analysis in xCode
The program reports the following error: @ synthesize of 'weak' property is only allowed in ARC or GC mode.

The current project is manual memory management. Therefore, when a third-party resource library is introduced, many resource libraries are updated to use arc for encoding, which leads to different code styles, sometimes developers may not notice these problems, and they will directly use them if they do not report any errors. But sometimes, because the arc Code uses a new attribute modifier, for example, weak cannot be compiled in the Code for manual memory management. The error message is: @ synthesize of 'weak' property is only allowed in ARC or GC mode, this is the conflict between the introduced arc Code in the project. One solution is to change the weak modifier in the resource code to assign, but this method is to change the code written by others after all, sometimes, crash and crash may occur.

A better solution is to select the project configuration file> Build Phrases> Complie Sources, find the problematic resource library file (such as the file where the weak modifier is located), and double-click the file in Complie Files, write-fobjc-arc in a blank row to effectively prevent this conflict. In turn, sometimes we introduce code for manual memory management in the arc Code. In Complie Files, we add-fno-objc-arc to the newly added resource file, this avoids conflicts between codes that manually manage the memory in the arc Code.

BMKGeoCodeSearch reverse geoencoding failed Location

The security code of the applied key is different from the build id in the Code. If it is changed to the same, it will be OK.

Create a new class, encapsulate the positioning function of Baidu map, and the agent method of positioning will not go

Positioning will continue, and we will create this class. If we do not set the STIC static variable, it will be automatically destroyed, and the object will not be located after destruction.

The Privacy positioning function of the ios8 system directly crashes.

The reason for this problem is definitely not the problem with the ios8 system, because other apps are good, why is there a problem with your app? It must be something wrong when you add code.
I searched the code several times and finally found that there is something different from others. That is, when setting the plist file variable, the Type BOOl should be String. It is estimated that Apple is determined by string comparison, so the BOOl type crashes directly.

Cateogry cannot be used to call methods in a category.

You need to import your extended class to the. m file of the extended class. Variables cannot be declared in the category.

The pop-up is not synchronized at the same time, pull up and refresh twice, sometimes the data source array will be empty, causing a crash

The data source array is loaded with laziness. Remember to assign nil to the array. It is best to do this.

The input box and keyboard pop-up are not synchronized

This indicates that the listening keyboard is incorrect. The listening should be the notification to be displayed on the keyboard instead of the notification to be displayed on the keyboard.

-[UITableView _ configureCellForDisplay: forIndexPath:]

Because-(UITableViewCell) TableView :( UITableView) TableView cellForRowAtIndexPath :( NSIndexPath *) nil is returned in the indexPath function.

The Xcode project file cannot be opened. cannot be opened because the project file cannot be parsed. (this may happen when the code is updated)

This is because the. xcodeproj project file conflicts.
Conflicting message information
<. Mine 9ADAAC6A15DCEF6A0019ACA8 .... In Resources/, ======= 52FD7F3D15DCEAEF009E9322... In Resources/, >>>>>>>. R269

Solution: 1. Right-click the. xcodeproj file and display the package content
2. Double-click to open the project. pbxproj file.
3. Find the above conflict information (search by commad + f)
4. Delete <, =====, >>>>> these rows
5. Save and exit
6. Open the. xcodeproj file again.

How do I not delete release when using files written by arc?

In the complies sources setting of build phases, set the corresponding file to-fno-objc-arc.

Problem: libxml/tree. h file not found Solution

Answer: 1. Import the libxml2.dylib package.

2. Set the Header Search Paths to/usr/include/libxml2 :! [Write picture description here] (http://img.blog.csdn.net/20160421084710872)
Problem: __dns_free_resource_r_dns_free email ring SDK integrated EaseMobSDK

"_ Dns_free_resource_record", referenced from:-[XMPPSRVResolver processRecord: length:] in libEaseMobClientSDKLite. a (XMPPSRVResolver. o)
This error is caused by the lack of libraries:
Add the libresolv. dylib library.

When using the pull-up/pull-down refresh method, if you exit the interface, remember to release the pull-up/pull-down refresh class (old version of MJRefresh)
Cannot jump controller in viewdidload

Problem: The program crashes when the AFNetworking request contains Chinese characters.

Pipeline * manager = [pipeline manager]; [manager GET: urlString parameters: nil success: ^ (AFHTTPRequestOperation * operation, id responseObject) {//} failure: ^ (AFHTTPRequestOperation * operation, NSError * error) {//}];
Error:
Assertion failure in-[AFHTTPRequestSerializer requestWithMethod: URLString: parameters: error:]
Encode urlString
UrlString = [urlString stringByAddingPercentEscapesUsingEncoding: NSUTF8StringEncoding];

Complete Solution OBJC_CLASS$ _ A file name ", referenced from: Problem

Http://www.cnblogs.com/g-ios/p/4625907.html

Cycler type 'tableviewcellframework' for instance message is a forward declaration
This is often a reference issue. ARC requires a complete forward reference, that is, in the MRC era. in h, you can declare @ class, but in ARC, if you call a method in the parent class that is not covered by a subclass, you must pair the parent class. h references. Otherwise, compilation fails.

After the program is released, a bug is found. When debugging on your mobile phone, the following error occurs: a valid provisioning profile for this executable was not found.

It is because the "Build Configuration" in the schema is changed to release during release. The provision corresponding to release is issued with the certificate. Just change "Build Configuration" to debug.
Because the App Transport Security policy requires the use of a secure connection

Network Access failed.
Output Error message: The resource cocould not be loaded because the App Transport Security policy requires the use of a secure connection. Google, check that iOS9 introduces The new feature App Transport Security (ATS ). Details: App Transport Security (ATS)

The new feature requires that the network accessed in the App must use the HTTPS protocol.
However, the company's projects now use the HTTP protocol and use private encryption to ensure data security. Currently, it cannot be changed to HTTPS.

Finally, find the following solution:Solution:
Add the NSAppTransportSecurity type Dictionary to Info. plist.
Add the NSAllowsArbitraryLoads type Boolean under NSAppTransportSecurity and set the value to YES.

Refer:

App Transport Security support aka apps on iOS 9 don't work #4560
711_networking_with_nsurlsession1 _

Summary:

Apple is increasing application security control. This measure shows that Apple attaches great importance to information security and exposes that most applications transmit data without encryption or use private encryption, so that Apple began to ask developers.
Although private encryption is secure to some extent, it is not a long-term solution. So many security experts around the world are maintaining HTTPS security. It is king to Use HTTPS to ensure information security as soon as possible! It also saves the security risks of private encryption protocols!

After xcode is updated, open svn again and you will be prompted that xcode/develop does not exist. In addition, you can use xcode-select to switch to your current xcode.

Below: sudo xcode-select-switch/Applications/Xcode-beta.app/

The path here is the most error-prone. I was confused by him for a long time. This is the application under the hard disk, not the application in the user, but the file name, try to remind him to avoid mistakes.

: Couldn't materialize: couldn't get the value of variable result: variable not available

Errored out in Execute, couldn't PrepareToExecuteJITExpression
This kind of error is more intuitive. When a code is executed, the created object will immediately become empty, but it will not affect the usage.

Coredata Can't merge models with two different entities named 'messagemodel'

This error occurs because a. xcdatamodeld file is automatically generated in the project. The solution is to delete the file, clean the file, delete the software from the test machine or the real machine, and run it again.

UitableView does not use the datasource Method

The number of rows not mounted by the proxy or the number of segments is set to 0. The frame of uitableview is 0.

Phone development] "This certificate is signed by an unknown authority" SOLUTION

Cause:
Previously, an additional certificate was deleted in the keychain: Apple Woldwide Developer Relations Certification Authority, which is the issuer of the iPhone Developer certificate, if it is deleted, the iPhone Developer certificate will be recognized as an unknown authority signature, and the above error will occur in xcode real machine debugging.

Solution:
Re-put AppleWWDRCA back; download one from the Apple official website (http://www.apple.com/certificateauthority/), download and drag into the keychain (key access)-login directory.

If you want to re-generate a certificate, Apple is allowed, as long as the App Id is not modified, OK.

Code Sign error: No code signing identities found: No valid signing identities (I. e. certificate and private key pair) matching the team ID "E9823ESPAM" were found.

When this problem occurs in the certificate, do not consider the certificate as a problem. Check whether the CDL and CDLtest in the target have the same configuration file.

A valid provisioning profile for this executable was not found. Real machine debugging

Since XCode supports automatic Certificate maintenance, it eliminates the trouble of manually adding devices and then downloading certificates after updating the certificates, but it has never understood the automatic maintenance mechanism, in this case, XCode often reports errors but does not automatically add devices. The certificate is created by XCode and cannot be modified manually. After a period of testing, I finally found a solution and shared it with you here.

Normally:
No provisioning profile was found for this executable
Then you can select Fix Issue, so XCode will automatically add the new device to the certificate for us, and then update the Certificate automatically. Possible errors:
A valid provisioning profile for this executable was not found
Solution:
1. Change the Team to the corresponding developer account Team on the Target General interface.
2. Change the Code Signing Identity in Build Settings of Target to iOS Developer (you cannot select your own), and change Provisioning Profile to Automatic
3. After cleaning, run it again. The Fix Issue dialog box appears. Select Fix Issue.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.