Storyboards
这里是吐槽时间,换掉了mac默认的输入法,出发点只有一个,就是切换中英文输入的时候相当不爽。也许是习惯了其他各大输入法的一键切换,而又没有找到自带输入法可设置的地方。
Segue
以前我们使用navigation controller 去push view controller, storyboards 里面相应的概念就是segue.还有一种切换的方式是modal view controller 从地下临时的弹出。类似于Jquery ui 中的模态对话框。prepareForSegue:sender:是一个重要的方法,你可以在这里传递数据到下一个view.
在一个StoryBoards上放两个ViewController
通过Ctrl 和拉伸或者右键拉伸的方式,连接两个view controller.
identifier
我们给这个segue 一个唯一识别名: pushLogin. 为什么我们需要这个识别名,因为我们打算在跳转之前作一些validation,比如说确认下客户的输入是否正确,否则我们不允许用户跳转到下一步。shouldPerformSegueWithIdentifi er:sender: method of UIViewController 就是我们执行validation 的方法。
因此我们上面的发送账户验证请求,不再需要绑定在按钮按下的事件中。
Synchronous http request
上面我们使用的是异步http request的方式,其实我们想要同步的分析请求结果,再确定是否跳转,因此这里需要阻塞。
NSURLResponse response = nil; NSError error = nil; NSData *data = [NSURLConnection sendSynchronousRequest:urlRequest returningResponse:&response error:&error];
当然,验证不通过,我们需要一个alert
- (void) showAccountIsNotValid{ UIAlertView *alert = [[UIAlertView alloc] initWithTitle:nil message:@"该用户不存在!" delegate:nil cancelButtonTitle:nil otherButtonTitles:@"OK", nil]; [alert show];}
Storyboards的更多相关文章
- Xcode5中如何切换Storyboards为xib
在Xcode5中,当创建一个带View的iPhone项目时,默认必须使用Storyboards,不再支持切换xib的checkbox.本文讲解如何手动切换到使用xib来布局. 1,把Main.stor ...
- 【Xamarin Doc】 Introduction to Storyboards 笔记
http://developer.xamarin.com/guides/ios/user_interface/introduction_to_storyboards/ Segues There are ...
- iphone dev 入门实例1:Use Storyboards to Build Table View
http://www.appcoda.com/use-storyboards-to-build-navigation-controller-and-table-view/ Creating Navig ...
- scenes & segues within storyboards
Scenes Scenes in a storyboard represent content shown within one screen in your application. A scene ...
- 从零开始学ios开发(十八):Storyboards(下)
这篇我们完成Storyboards的最后一个例子,之前的例子中没有view之间的切换,这篇加上这个功能,使Storyboards的功能完整呈现.在Storyboards中负责view切换的东西叫做“s ...
- 从零开始学ios开发(十七):Storyboards(上)
在开始这章之前,先做个说明,从这篇开始,我所使用的xcode更新成了最新的版本,版本是4.6.1(4H512),如下: 大家可以打开自己电脑上的App Store,然后搜索xcode,第一个出现的就是 ...
- Storyboards vs NIB vs Code 大辩论
前言 做iOS开发的童鞋都应该会纠结一个问题,那就是在做开发的时候是使用StoryBoard还是使用Nibs又或者是Code(纯代码流)呢?笔者也非常纠结这个问题,今天碰巧在raywenderlich ...
- 转换到 StoryBoard 的公布说明(Converting to Storyboards Release Notes)
转换到 StoryBoard 的公布说明(Converting to Storyboards Release Notes) 太阳火神的漂亮人生 (http://blog.csdn.net/opengl ...
- Storyboards Tutorial 01
Storyboarding 是在ios 5时候引进入的一个非常出色的特性.节省了为app创建user interfaces的时间.
随机推荐
- Python类的特点 (1):构造函数与方法
Python中,类的特点: #encoding:utf-8 class Parent(object): x=1 #x是Parent类的属性(字段) def __init__(self): print ...
- Zigzag Iterator
Given two 1d vectors, implement an iterator to return their elements alternately. For example, given ...
- c#.net Excel中的数据导入到SQL数据库中
/// <summary> /// 从Excel 导入学生 /// </summary> /// <param name=&qu ...
- 【leetcode】Merge k Sorted Lists
Merge k Sorted Lists Merge k sorted linked lists and return it as one sorted list. Analyze and descr ...
- (转)利用eclipse external tool 执行mvn jetty:run
一.如果这个工程是标准的maven-webapp那么基本上不用修改,直接运行jetty:run就可以执行. 但是有时候会报错说 [ERROR] No plugin found for prefix ' ...
- cas 单点登录出现org.jasig.cas.client.util.CommonUtils.getResponseFromServer - 拒绝连接 Connection refused
cas 单点登录出现org.jasig.cas.client.util.CommonUtils.getResponseFromServer - 拒绝连接 Connection refused 环境: ...
- codeforces 425C Sereja and Two Sequences(DP)
题意读了好久才读懂....不知道怎么翻译好~~请自便~~~ http://codeforces.com/problemset/problem/425/C 看懂之后纠结好久...不会做...仍然是看题解 ...
- Lake Counting_深度搜索_递归
Lake Counting Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 30414 Accepted: 15195 D ...
- 重写Equals为什么要同时重写GetHashCode
.NET程序员都知道,如果我们重写一个类的Equals方法而没有重写GetHashCode,则VS会提示警告 :“***”重写 Object.Equals(object o)但不重写 Object.G ...
- jquery $(document).ready() 与window.onload的异同
Jquery中$(document).ready()的作用类似于传统JavaScript中的window.onload方法,不过与window.onload方法还是有区别的. 1.执行时间 ...