//
// Viewcontroller. m
// Helloworld
//
// Created by Apple on 14-7-8.
// Copyright (c) 2014 Camp David education. All rights reserved.
//
# Import "viewcontroller. H"
@ Interface viewcontroller ()
@ Property (weak, nonatomic) iboutlet uiwebview * webview;
@ Property (weak, nonatomic) iboutlet uilabel * label;
@ Property (weak, nonatomic) iboutlet uitextfield * textfield;
@ End
// Click the button to change the label content
@ Implementation viewcontroller
-(Ibaction) clicked :( ID) sender {
// Printf ("Hello, clicked \ n ");
[Email protected] "Click! ";
}
// Click the button to input the content in the text control to the label.
-(Ibaction) clicktext :( ID) sender {
Self. Label. Text = self. textfield. text;
}
// Web browsing
-(Ibaction) click3 :( ID) sender {
// Generate a URL
Nsurl * url = [nsurl urlwithstring: @ "http://www.baidu.com"];
// URL request
Nsurlrequest * request = [nsurlrequest requestwithurl: url];
// Webpage Loading
[Self. webview loadrequest: request];
}
-(Ibaction) segment :( uisegmentedcontrol *) sender {
Printf ("segment: % d", Sender. selectedsegmentindex );
}
// The degree to which the slider is output
-(Ibaction) slider :( ID) sender {
Uislider * slide = (uislider *) sender;
Nslog (@ "slide: % F", slide. value );
}
-(Void) viewdidload {
[Super viewdidload];
// Do any additional setup after loading the view, typically from a nib.
}
-(Void) didreceivememorywarning {
[Super didreceivememorywarning];
// Dispose of any resources that can be recreated.
}
@ End