Common errors in OC Xcode

Source: Internet
Author: User
Tags socket error

In the process of development will inevitably encounter a lot of errors, but when you see the system given in English, do not know what the meaning. So this article summarizes some of the common English words and phrases in Xcode that can help beginners quickly understand the hints they give. More practice, you will certainly be able to master the basic.

Expression: Expressions

Assignable: Assign Value
Variable: variable +
redefinition: repeating definition
Type: Types
Conflicting: Conflicting items
Invalid: invalid
Conversion: Conversion
Specifier: specifier
Indent: Indent
Operands: operand, operand
Binary: Binary
Expected: Expectations
Logical: Logic
Const: constant
Constant: constant
Statements: statement
Initialization: Initialization
Condition: Conditions
Increment: Incremental
Index: Indexes, subscript
Abbrev: Shorthand, abbreviation
Alias: aliases, pseudonym
Modified: Modified/improved
Parameter: Parameters
Implicit: Implied
Undo: Cancel
Redo: Redo
Cancel: Canceled
Octal: eight-binary
Incompatible: Mismatched
Duplicate: Repeat
Action: Behavior
Instance: Example
Modify: Modify
General: Normal in: broadly, generally
Subclass: Sub-class
Superclass: Parent class
Inherit: Inheritance
Contents: Content
Primitive: The original
Modify: Modify
Ordered: an orderly
Collection: Collection
Dynamic: Dynamically
Querying: Query
Deriving: Derivation
Description: Descriptive, descriptive
Collection: Collection
Programmatic: Programmed
A set of: A series, a set
Overview: Overview
Related related
Declared in: Declare in ... (In the file)
Availability: Available
Framework: Frameworks, class libraries
Conforms to: Obey .... Agreement
Conforms: Obedience
Dynamic: Dynamics
Term: Articles
Exact: Exactly.
Membership: Member
Entry: Articles
Consists of: by ... Composition
Unique: Distinctive, unique
Determined: Decision
Conform to: Obey, follow
Protocol: Protocol
Distinct: different, unique
Addition: Add, increase
Literals: Literal
Denote: Indicate, indicate
Category: Categories, categories
Concrete: The specific
Decouples: Decoupling
Kvc:key-value Coding: Key-value pair encoding

Getting Numeric values: Get a value
Identifying and comparing Strings: identifying and comparing strings
Replacing substrings: replacing substrings
Finding characters and substrings: finding characters and substrings
Dividing Strings: Split string
Combining Strings: Stitching strings
Getting C Strings: Get the C language string
Getting characters and Bytes: getting characters or bytes
Getting A string ' s length: Gets the lengths of the strings
Writing to a file or URL: Writes the content to a document or URL
Creating and Initializing A string from a file: Create and initialize a string from a document
Deprecated: Deprecated
Creating and Initializing Strings: Creating an initialization string
Tasks: Features
Adopted protocols: adopted/obeyed protocol

1:local declaration "XXX" Hide instance variable

Reason: It is generally the name of the variable and class attribute variable that you define in your function. There is a rare case of duplicate system variables. In this case, it would be nice to change the name of the variable.

2, Undefined symbols for architecture x86_64:

may be due to the fact that some class libraries do not support the architecture-

options that can be set to non -Architecture in project build Setting = "

3. Compile warning: Ld:warning:directory not found foroption

Select Project, compile (targets)

Choose the Build Settings menu

Locate the Library search Paths and the Framework search Paths, and delete the path of the compiled report warning OK

4, Undefined symbols for architecture armv7s: "_objc_class_$_szadwebviewdelegate", referenced from:xxxx

Find a half-day, always think that a file is missing, after comparison of normal sample found problems in the armv7s, which is for the IPhone5 CPU optimization of the compilation, perhaps you do not support a library, the solution is:

The value of Build setting->build Active Architecture only is set to YES by NO and the data forthis option is checked:

This property is set to Yes, which compiles faster at debug time and compiles only the current version of architecture.

When set to No, all versions are compiled.

this is the device corresponding to the architecture:

ARMv6: IPhone 2g/3G, iPod1g/2G

ARMv7: IPhone 3gs/4/4s, iPod3g/4G, IPad1g/2g/3G

armv7s: iPhone5, IPod5

The compiled version is backwards compatible (not quite, it should be said, the device is backwards compatible), such as you set this value to Yes, compiled with iphone4 is the armv7 version,Iphone5 can also run, but The ARMV6 device cannot be run.

Therefore, the General debug time can choose to set to Yes,release should be changed to No, to adapt to different devices.

5. Xcode "Attaching to ..." stuck, simulator stays on the start screen

There are many ways online, what clean Build Folder, and various deletions, but there is a point is the priority to consider, that is, the host has not been modified, fixed as follows:

1, Error:macro names must be identifiers yourproject_prefix.pch

Cause: Because you soiled the preprocessor macro, it was modified when it was in <multiple values>

Workaround: Configiration Select all Configirations, clear it and redefine your DEBUG,RELEASE,DISTRIBUTIN preprocessor macro separately

2. Warning:no rule to process file ' $ (project_dir)/loadingview.h ' of type sourcecode.c.h for architecture ARMv6

Reason: Target compile sources contains the header file, where the face does not need a header file

Workaround: Delete the header file from target compile sources

3. Command/developer/platforms/iphoneos.platform/developer/library/xcode/plug-ins/iphoneos Build System Support.xcplugin/contents/resources/copypng failed with exit code 1

Cause: PNG image file copy failed, look at the information above to suggest can ' t find which file, generally is deleted from the file system files without the result of Xcode deletion, Xcode project configuration file still records the reference of this file

Workaround: Add the appropriate file to the filesystem or delete it from Xcode's groups & files, or delete it from Target's copy Bundle resources

4. Code sign error:the identity ' iPhone developer:your Name ' doesn ' t match any valid certificate/private key pair in the Default Keychain

Cause: Signature Error

Workaround: Modify signature, Code Signing, Build, Target, Get Info

Remember that the configuration type in the upper-left corner corresponds to the current build type (Debug, Release, distribution), or change to white

5, could not create bundle folder for versioned model *.moda (as if this suffix name of this file)

Cause: Compiling once will result in a new

Solution: should be compiled out of the Moda files are deleted, and then clean under the project, re-build can

6, Error:there is no valid certificate/private key pairs in the default keychain

7. Error:cannot assign to "self" outside of a method in the Init family

Cause: You can only be assigned to self in the Init method, and Xcode determines whether the Init method rule: method returns the ID, and the name starts with the init + capital Letter + other as the guideline. For example:-(ID) initwithxxx;

Error code:-(ID) myinit{

self = [super init];

......

}

WORKAROUND:-(ID) initwithmy

{

self = [super init];

}

1, iOS Real machine debugging, Error:failed to get the task for process 20900

Reason:

For certificate issues, both project and targets certificates must be development certificates, and this issue occurs with adhoc certificates.

Solution:

Project and targets certificates use the development certificate.

2, when a socket is connected, then a new socket to establish a link, will throw the error " attempting to connect while connected or accepting connections. Disconnect first. ".

Reason:

The first socket has not returned isconnected for Yes, a second socket connection is established.

Solution:

Asyncsocket has a property calledisdisconnected, but the interface is not open, will-(BOOL) isdisconnected;
Added to the AsyncSocket.h. Then at the junction: if (![ _sendsocket isdisconnected])

{

[_sendsocket disconnect];

}

3,TCP socket willdisconnectwitherror:error domain=nsposixerrordomain code=65

"The operation couldn ' t be completed. No route to host "

No route to host (socket error:: 10065)  

This issue occurs because the network connection is not on this server.

Workaround: Check that the IP is correct, and see if the Debug device network connection is healthy.

4, error:calayer bounds contains NaN:

When drawing, an operation with a divisor of 0 is included in a length-width value.

5, error:libxml/tree.h not found

Solution:

Step 1:

Engineering-->project-->build Settings

Set the value of "Header Search Paths" to <${SDK_DIR}/usr/include/libxml2>.

Step 2:

Engineering-->targets-->build Settings

Set the value of "Header Search Paths" to <${SDK_DIR}/usr/include/libxml2>.

Common errors in OC Xcode

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.