Objective-what are the things you need to know about in C language?

Source: Internet
Author: User

Objective-what are the things you need to know about in C language?
I. What is Xcode, Objective-C, and Cocoa talking about? Xcode: You can regard it as a development environment, just like Visual Studio, Netbeans, or SharpDevelope. You can compare Interface Builder to the program separately extracted by the functions used to draw interfaces in Visual Studio. Objective-C: Of course, it is a programming language-.-Just like C, C ++, and Java ~ Cocoa: It's a bunch of functions that you just need to use. Yes, that is, "Improving writing efficiency, instead of continuously improving programming capabilities, but eliminating 70 percent of code" said by Joe ". Library, such as MFC,. NET, or Swing. A bunch of ready-made Objective-C files have been written by others. Is Objective-c a magic horse? The following lists the questions that Objective-C will ask: Question 1: I have seen a lot of minus signs in the program. What is the difference between brackets and what I have seen before, and NS *** is a magic horse -. -1. minus sign (or plus sign) minus sign indicates the start of a function, method, or message. For example: # import <Foundation/Foundation. h> # import "Student. h "@ implementation Student-(int) getAge {return age;}-(void) setAge :( int) newAge {age = newAge;} @ end 2. brackets can be considered to call the method you just wrote. For example: # import <Foundation/Foundation. h> # import "Student. h "int main (int argc, const char * argv []) {@ autoreleasepool {Student * stu = [Student alloc]; stu = [stu init];} return 0 ;} @ end 3. NS *** Steve Jobs was squeezed out of a company named NextStep after Apple. A complete set of development kits is a favorite of scientists. Now Mac OS uses the NextStep function library. These NextStep developers remember to name all the NextStep class abbreviations in the function library. Is NS ***, such as NSLogNSStringNSImageNSURLNSInteger... during learning, you will often see: NSLog (@ "% d", myInt); the pictures in ne are mainly used in the console for tracking, you will see the value of myInt in the console (open the dbg window when running in XCode ). In other development environments, we may prefer to use MessageBox for debugging. You can also see other classes with names, such as CF, CA, CG, and UI, for example, CFStringTokenizer is a word splitting task called CALayer. This indicates the CGPoint layer of Core Animation. This indicates a point of UIImage. This indicates that iPho CF is about Core Foundation, and CA is about Core Animation, CG is about Core Graphics, and UI is about the iPhone User Interface ...... There are many other things you can find yourself. Question 2: # What is import? 1. # import you can think of it as # include. 3. Other things 1. idObjective-C has a special data type id. In Objective-C, all data is saved as pointers. What you get is the location of the object in the memory. 2. BOOL, YES, NO. You can think that YES is true in c # or Java, and NO indicates false. In fact, YES is 1, NO is 0, and BOOL itself is a char. 3. NULL in nillObjective-C is written in this way, indicating a NULL pointer. 4. Why is the @ "string" instead of "string" "character string" a c string, and @ "string" is a shorthand for converting a C string to an NSString. NSString must be converted, for example, in NSLog. You must use a "String" in the place where the C String is required. In addition, @ "" does not support Chinese characters, and NSLog (@ "string") cannot output Chinese characters. Iv. Conclusion 1. Objective-C is only a programming language, not a Martian language. It can be integrated as long as we carefully learn and adapt to appropriate methods. 2. Add www.Cocochina.com to your favorites. When you cannot understand the code, let's take a look at some good articles. 3. The best way to learn a language is to use middle school. This is the same as learning a foreign language. You will naturally read what you say. Set up a simple goal for yourself, such as creating a simple program and solving the problem a little bit. In this way, learning is much faster than just looking at examples.

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.