TAILIEUCHUNG - HandBooks Professional Java-C-Scrip-SQL part 118

Tham khảo tài liệu 'handbooks professional java-c-scrip-sql part 118', công nghệ thông tin, kỹ thuật lập trình phục vụ nhu cầu học tập, nghiên cứu và làm việc hiệu quả | Line 9. If sig is still nil at this point your delegate is not equipped to handle the forwarded message. This would certainly be a programming error. If you return nil your program will crash. Your best recovery strategy is to have a specialpurpose class with a single method unused anywhere in your program. Returning its method signature lets your -forwardinvocation method detect that the delegate won t handle it and instead ignore it. Next you override - forwardinvocation to redirect the call 1 - void forwardInvocation NSInvocation inv 2 if myDelegate respondsToSelector 3 inv selector 4 inv invokeWithTarget myDelegate 5 else 6 super forwardInvocation inv 7 Line 1. The parameter contains information about the method call the selector parameter values and types and return type. Line 2. Check that the delegate actually handles the call. Line 4. If the delegate will handle the call forward the message. Line 5. If you intend to just ignore messages that the delegate won t handle you don t need this line or line 6. Line 6. If your parent class may have an alternative way to forward the message pass the invocation object to it using the super keyword. Memory Management The liveness of an object whether or not it is referenced by other objects currently in use is inherently a global property. This means that keeping track of object usage tempts you to breach the encapsulation and modularity of your program. There are several approaches you can use with Objective-C to help manage object lifecycles Manual memory management using the free functions provided by the Objective-C runtime Semi-automatic memory management using root class referencecounting methods Automatic memory management using third-party garbage collector tools The programming tools and libraries you use may constrain you toward or away from some strategies. For example the Cocoa class library uses reference counting if your code uses Cocoa objects it will have to be written to manage those objects with

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.