//
//  MyviewViewController.h
//  XibDemo
//
//  Created by hehe on 15/9/21.
//  Copyright (c) 2015年 wang.hehe. All rights reserved.
//

#import <UIKit/UIKit.h>

@interface MyviewViewController : UIViewController

@property (weak, nonatomic) IBOutlet UIButton *Go;

- (IBAction)onclic:(id)sender;

@property (weak, nonatomic) IBOutlet UITextField *textfield1;

@property (weak, nonatomic) IBOutlet UIWebView *web;
@end

//
//  MyviewViewController.m
//  XibDemo
//
//  Created by hehe on 15/9/21.
//  Copyright (c) 2015年 wang.hehe. All rights reserved.
//

#import "MyviewViewController.h"

@interface MyviewViewController ()

@end

@implementation MyviewViewController

- (void)viewDidLoad {
    [super viewDidLoad];

}

- (IBAction)onclic:(id)sender {
    
    NSURL *url = [NSURL URLWithString:_textfield1.text];
    
    NSURLRequest *request = [NSURLRequest requestWithURL:url];
    
    [_web loadRequest:request];
    
    [_textfield1 resignFirstResponder];
}
@end

//在appdelegate中的代码

//
//  AppDelegate.m
//  XibDemo
//
//  Created by qianfeng on 15/9/21.
//  Copyright (c) 2015年 qianfeng. All rights reserved.
//

#import "AppDelegate.h"
#import "MyviewViewController.h"

@interface AppDelegate ()

@end

@implementation AppDelegate

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
    // Override point for customization after application launch.
    
    self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds] ];
    self.window.backgroundColor = [UIColor whiteColor];
    
    //    ViewController *vc = [[ViewController alloc]init];
    MyviewViewController *vc = [[MyviewViewController alloc] initWithNibName:@"MyviewViewController" bundle:nil];
    
    self.window.rootViewController = vc;
    [self.window makeKeyAndVisible];
    
    return YES;
}

@end

XibDemo的更多相关文章

  1. iOS Xib布局某些控件显示或隐藏<约束的修改>

    对于这个问题使用Masonry是很好解决的. 注意:绿色的是label2,当indexpath.section % 2 == 0时,label2不存在. 关键代码如下: if (indexPath.s ...

随机推荐

  1. cdoj 03 BiliBili, ACFun… And More! 水题

    Article Time Limit: 20 Sec  Memory Limit: 256 MB 题目连接 http://acm.uestc.edu.cn/#/problem/show/3 Descr ...

  2. grep经常使用使用方法

    grep简单介绍 正如linux的man文件里所描写叙述的那样: grep searches the named input FILEs (or standard input if no files ...

  3. android环境部署(1.1)

    前言 对于android文件的解释和说明下载,这里分享一个博客大家了解吧.这里作者提供的下载地址可能有无效的,关键是解析..... 转自:http://www.cnblogs.com/bjzhangh ...

  4. wampserver下打开phpMyAdmin出现403错误的问题解决方法

    图1 图2 wamp下打开phpMyAdmin出现403错误的问题解决方法安装完wamp后打开其下的phpMyAdmin也就是路径http://localhost/phpmyadmin/ 出现[图一] ...

  5. UITableViewController

    UITableViewController 目录 概述 UITableView UITableViewCell 与UITableViewController相关的代理 UITableViewDataS ...

  6. 虚拟机Linux和Windows之间互传文件的好帮手WinSCP

    WinSCP下载地址:http://download.pchome.net/internet/ftp/down-34064-1.html 安装很简单,这里就不做介绍.下面是启动后的界面: 在主机名(H ...

  7. C# 网络通信大小端转换类

    本篇文章主要介绍了"C# 网络通信大小端转换类" using System;namespace Framework.NetPackage.Common { /// <summ ...

  8. java中静态的代码块,静态变量,静态方法

    简单了解一下java虚拟机--jvm几个内存区域: 方法区:在java的虚拟机中有一块专门用来存放已经加载的类信息.常量.静态变量以及方法代码的内存区域, 常量池:常量池是方法区的一部分,主要用来存放 ...

  9. C++类设计2(Class with pointer members)

    二 Class with pointer members(Class String) 1. 测试代码(使用效果) int main() { String s1(), String s2("h ...

  10. js数组的管理[增,删,改,查]

    今天在设计表单的时候遇到对数组的一些处理的问题,比如说怎么创建一个数组,然后牵扯到数组的增删改查的方法.请看API FF: Firefox, N: Netscape, IE: Internet Exp ...