TAILIEUCHUNG - Programming in Objective-C 2.0 edition phần 2

tạo ra một đóng cửa đối với từng phương pháp nào bạn muốn giả, và thiết lập đó vào MetaClass cho các ví dụ được Sản lượng từ các bit mã trước đây là yên tâm vượt qua các thử nghiệm, như thể hiện ở đây:Cách tiếp cận trọng bạn đã thấy trong mục 16,5 Mocking Thay, trên trang 244 là hữu ích cho cả hai mã Java và Groovy. | 50 Chapter 4 Data Types and Expressions the digits and values larger than 999 cannot be expressed using commas. So the value 12 000 is not a valid integer constant and must be written as 12000. Two special formats in Objective-C enable integer constants to be expressed in a base other than decimal base 10 . If the first digit of the integer value is 0 the integer is considered to be expressed in octal notation that is in base 8. In this case the remaining digits of the value must be valid base 8 digits and therefore must be 0 7. So to express the value 50 in base 8 in Objective-C which is equivalent to the value 40 in decimal the notation 050 is used. Similarly the octal constant 0177 represents the decimal value 127 1 X 64 7 X 8 7 .An integer value can be displayed in octal notation by using the format characters o in the format string of an NSLog call. In such a case the value is displayed in octal without a leading format character o does cause a leading zero to be displayed before an octal value. If an integer constant is preceded by a 0 and a letter x either lower case or upper case the value is considered to be expressed in hexadecimal base 16 notation. Immediately following the x are the digits of the hexadecimal value which can be composed of the digits 0 9 and the letters a f or A F .The letters represent the values 10 15 respectively. So to assign the hexadecimal value FFEF0D to an integer variable called rgbColor you can use this statement rgbColor 0xFFEF0D The format characters x display a value in hexadecimal format without the leading 0x and using lowercase letters a f for hexidecimal display the value with the leading 0x you use the format characters x as in the following NSLog Color is x n rgbColor An uppercase X as in X or X can be used to display the leading x and hexidecimal digits that follow using uppercase letters. Every value whether it s a character an integer or a floating-point number has a range of values associated .

TỪ KHÓA LIÊN QUAN
TAILIEUCHUNG - Chia sẻ tài liệu không giới hạn
Địa chỉ : 444 Hoang Hoa Tham, Hanoi, Viet Nam
Website : tailieuchung.com
Email : tailieuchung20@gmail.com
Tailieuchung.com là thư viện tài liệu trực tuyến, nơi chia sẽ trao đổi hàng triệu tài liệu như luận văn đồ án, sách, giáo trình, đề thi.
Chúng tôi không chịu trách nhiệm liên quan đến các vấn đề bản quyền nội dung tài liệu được thành viên tự nguyện đăng tải lên, nếu phát hiện thấy tài liệu xấu hoặc tài liệu có bản quyền xin hãy email cho chúng tôi.
Đã 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.