HandBooks Professional Java-C-Scrip-SQL part 104

(id) Indicates that the return type is id. perform: The first part of the method name. This method name has two parts, one preceding each of the parameters. The full method name is perform:with:. Methods with more parameters follow the same pattern as shown here. The second, third, etc. parts of a method name don't need any textual characters, but the colons are required. (SEL) Specifies that the first parameter has the type SEL. sel The name of the first parameter. with: The second part of the method name. (id) Specifies that the second parameter has the type id. obj. | id Indicates that the return type is id. perform The first part of the method name. This method name has two parts one preceding each of the parameters. The full method name is perform with . Methods with more parameters follow the same pattern as shown here. The second third etc. parts of a method name don t need any textual characters but the colons are required. SEL Specifies that the first parameter has the type SEL. sel The name of the first parameter. with The second part of the method name. id Specifies that the second parameter has the type id. obj The name of the second parameter. A variable number of parameters - id error char format . This declaration can be broken down as follows Indicates an instance method. id Indicates that the return type is id. error The entire method name. In this case the second and subsequent parameters are not prefaced by extensions of the method name. char Specifies the type of the first parameter. format The name of the first parameter. Represents the variable-size parameter list. Ellipses like these can only appear at the end of a method declaration. In the method access the list using the standard C variable-arguments interface. Implementing a method The body of a method appears in the implementation section of a class. The method starts with a declaration identical to that of the interface section and is followed by code surrounded by braces. For example - void scaleBy float factor radius factor Inside a method body refer to fields the class declares or inherits with no qualification. Refer to fields of other objects using the dereference - operator. Objective-C defines three special variables inside each method self The receiver of the method call. super A reference to the inherited version of the method if there is one. _cmd The selector an integer that uniquely specifies the method. Section describes these special variables in more detail. Calling a method Every method call has a .

Không thể tạo bản xem trước, hãy bấm tải xuống
TÀI LIỆU LIÊN QUAN
5    176    1
5    255    1
5    106    0
5    121    1
6    103    1
6    107    1
6    121    1
6    103    0
6    140    0
TÀI LIỆU MỚI ĐĂNG
214    212    1    30-06-2024
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.