Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is xcLanguageSpecificationIdentifier for?

Tags:

xcode

After you make global search and replace operation in Xcode it adds xcLanguageSpecificationIdentifier and lineEnding to every manipulated file entry in *.pbxproj files in the form of e.g.:

036B04CB1B2AE8A70010F649 /* MyClass.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MyClass.m; sourceTree = "<group>"; };

to:

036B04CB1B2AE8A70010F649 /* MyClass.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = MyClass.m; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.objc; };

What is it for?

Does it improve something like search performance?

If yes, how can I generate it for other files without making search and replace operation?

If no, how can I prevent Xcode from creating such things?

like image 647
Piotr Tobolski Avatar asked Sep 30 '15 12:09

Piotr Tobolski


People also ask

What is the identifier in C language?

"Identifiers" or "symbols" are the names you supply for variables, types, functions, and labels in your program. Identifier names must differ in spelling and case from any keywords. You cannot use keywords (either C or Microsoft) as identifiers; they are reserved for special use.

Why are identifiers used in C?

C Identifiers Identifier refers to name given to entities such as variables, functions, structures etc. Identifiers must be unique. They are created to give a unique name to an entity to identify it during the execution of the program.

What is identifier used for?

Identifiers are symbols used to uniquely identify a program element in the code. They are also used to refer to types, constants, macros and parameters. An identifier name should indicate the meaning and usage of the element being referred.

What is identifier explain with example?

An identifier is nothing but a name assigned to an element in a program. Example, name of a variable, function, etc. Identifiers in C language are the user-defined names consisting of 'C' standard character set. As the name says, identifiers are used to identify a particular element in a program.


1 Answers

I think xcLanguageSpecificationIdentifier is just a temporary indication from Xcode 6 with Swift's comming; and you can find it in your project.pbxproj if you write mixture code with Swift and objc.

For example, you have ProfileVC.h and ProfileVC.m, then you delete ProfileVC.h and rename ProfileVC.m to ProfileVC.swift (and rewrite it in Swift), in your projectName.xcodeproject/project.pbxproj, some line change from

    49E89AB31C3D4494006C95BB /* ProfileVC.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ProfileVC.m; sourceTree = "<group>";};

to

    49E89AB31C3D4494006C95BB /* ProfileVC.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; lineEnding = 0; path = ProfileVC.swift; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.objc; };

However, in this situation, code in ProfileVC.swift seems not correctly colored, and code completion is broken. I delete the part xcLanguageSpecificationIdentifier = xcode.lang.objc; and everything goes quite OK.

like image 104
DawnSong Avatar answered Nov 04 '22 10:11

DawnSong