TAILIEUCHUNG - Phát triển ứng dụng cho iPhone và iPad - part 33

Tham khảo tài liệu 'phát triển ứng dụng cho iphone và ipad - part 33', 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ả | XML and the iPhone SDK 289 Called when the parser finishes parsing the document - void parserDidEndDocument NSXMLParser parser NSLog parserDidEndDocument The code is relatively straightforward. First for illustrative purposes you log the name of the method that you are executing. This will prove instructive when you look at the console log. Examining the order in which the parser calls the delegate methods will help you to better understand how the parser works. Additionally it is useful for debugging purposes should you encounter an error in your parsing logic. In the parserDidStartDocument method you also initialize the inItemElement flag to NO because you are not currently in an item element. In the parserDidEndDocument method you log that you have reached the end of the document. Next you implement the start and end element functions. Here is the parser didStartElement namespaceURI qualifiedName attributes method implementation 0 Called when the parser encounters a start element - void parser NSXMLParser parser didStartElement NSString elementName download on a namespaceURI NSString namespaceURI qualifiedName NSString qualifiedName attributes NSDictionary attributeDict NSLog didStartElement Check to see which element we have found if elementName isEqualToString item We are in an item element inItemElement YES If we are in an item and found a title if inItemElement elementName isEqualToString title Initialize the capturedCharacters instance variable capturedCharacters NSMutableString alloc initWithCapacity 100 This method receives the name of the element that has started as a parameter. You check the name of the element and set the inItemElement flag if you have started an item element. Next check to see if you have started a title element. You may be wondering why you are checking to see if you have started a title element when you already know that you have started an item 290 CHAPTER 10 WORKING 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.