iOS development--stage three--Weibo (4) (Program 2)

Source: Internet
Author: User

Design ideas:

Design code according to MVC

New Zyloginwebview inherited from UIView

Adding the WebView property in ZYLoginWebView.h

Create an initialization webview in the Zyloginwebview initialization method and add

Set up the Proxy import Protocol to implement two Protocol methods

To override the Layoutsubviews method method, set the WebView frame

Let WebView load request request into M-tube new model class Zysinaengine

Add a plus method to the Zysinaengine class (convenient) authorizereuqest returns a request

The Authorizereuqest method implementation requires many of the parameters of the application created by Sina and the parameters are used many times so the macro is defined in the Zysinaengine

Defined in ZYLoginWebView.h

-(void) Loadauthorizerequest: (nsurlrequest *) request;

Create and initialize the Zyloginwebview in Timelineviewcontroller and then load the request

Receive code in the WebView proxy method

Need to tell Timelineviewcontroller to use protocol after receiving code

Because Zyloginwebview wanted to send messages to someone, so there should be a Delegate object property id< protocol name > Delegate in Zyloginwebview

Write the Protocol method in Zyloginwebview and invoke the Protocol method in. m

The composition of the Nserror

Timelineviewcontroller implementing proxy methods get the code.

iOS development--stage three--Weibo (4) (Program 2)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.