onfirのブログ -20ページ目

onfirのブログ

ブログの説明を入力します。

You've mastered the Objective-C, and always wanted to learn cool stuff? Read this article now! This article will introduce iOS developer C ++. Later I will introduce, Objective-C can seamlessly use C and C ++ code. Therefore, based on the following reasons, iOS developers to understand C ++ will be helpful: 1. Sometimes you want to use a library written in C ++ in the application. ? 2. You may use C ++ to write part of the application code to make it easier cross-platform portability. 3. Learn other languages ​​can often help you better 180-159220 Nike LeBron 7 VII Soldier White Black Running Shoes understand the program. This article has been understood for those of iOS Objective-C developers. This assumes you already know how to write Objective-C code, and C familiar with basic concepts, such as type, pointer, function and so on. Ready to learn C ++ that? Then start now! Start: 2013 Air Jordan 4 (IV) Retro A Brief History Nike Shoes of Language C ++ and Objective-C are some common source: they are rooted in the old easy to use C language, C language are 'super-set.' Therefore, you can use the additional features some of the features of the C language, and each language in these two languages. If you are familiar with Objective-C, then you will be able to roughly understand C ++ code that you encounter. For example, the two languages ​​of numeric types (int type, float type and char type) expressions and usage rules are exactly the same. Objective-C and C ++ are based on the C language adds object-oriented features. If you are not familiar with the 'object-oriented', then you really 2012 Cheap Nike Air Jordan 1 High Heels For Sale Beige Pink need to understand is that the object-oriented data refers to the object represented by, and the object is an instance of the class. In fact, C ++ was originally called Air Jordan 13 'C with Classes', the inner meaning is to make the C ++ object-oriented. 'So what's the difference?' I hear your question. The biggest difference is in the method of object-oriented features. In C ++, a lot of behavior that occurs at compile time, but in Objective-C, the majority occurred at runtime. You may have to modify the Objective-C run-time to achieve a similar method swizzling trick, but in C ++, which is impossible. C ++ also like Objective-C, like a lot of introspection and a mapping method. In C ++, there is no way to get the class C ++ objects, but in Objective-C, you can call the 'class' method in an instance. Similarly, in C ++, there is Air Jordans Men's no equivalent isMemberOfClass or isKindOfClass classes. More than cursory introduction to C ++ displays the history and main differences between C ++ and Objective-C's. History section has been completed, we continue to learn C ++ features time. C ++ classes in any object-oriented language, first you have to know is how to define a class. In Objective-C, you define a class by creating a header file and an executable file, the same is true in C ++, the syntax is very similar. Air Max for Women Below, it is an example of Objective-C classes: // MyClass.h #import \u0026 lt; Foundation / Foundation.h \u0026 Lebron James Shoes gt;interface MyClass: NSObjectend // MyClass.m #import 'MyClass.h'implementation MyClassend As an experienced iOS developer you should be very clear, but look at the same example written in C ++: // MyClass.h class MyClass {}; // MyClass.cpp #include 'MyClass.h' / * Nothing else in Nike shoes online here * / Here are some essential differences. First, C ++ implementation file in nothing, it is because you did not declare any of the methods in the class. Air Jordan 10 Similarly, as Objective-C, an empty class does not need @ implemenation / @ end modules. In Objective-C, almost every class inherits from NSObject. You can create your own root class, which means you will not have any class Air Jordan 1 superclass. However, you may have never done it before, unless you are just fun to run. Contrast C ++, as the above examples, create a class that does not exceed the class is very common. Another slight difference is #include and #import. Objective-C will #import preprocessor directive to C. Not the same in C ++, the standard C-style is to use #include. #import Air Jordan 12 In Objective-C is to ensure that a file is included only once, but in C ++ you have to check for yourself. Class member variables and member functions, of course, much more than declare a class thing. Air Max for Men As in Air Jordan 11 Objective-C Nike Shoes Global and C ++, you can add instance variables and methods in the class. Perhaps you know C ++ is not the case in these two named, C ++ is usually called member variables and member functions.