在ios开发中,我们经常需要用到传值来实现对数据的传递和加载,不管是跨页面的传值还是不跨页面的传值,关于传值的实现我简单的做了以下总结:
一:利用通知(NSNotificationCenter)进行传值:
首先我们从ViewController跳到RootViewController中,在RootViewController中写如下代码:
...
分类:
移动开发 时间:
2015-08-19 13:28:15
阅读次数:
142
#import "RootViewController.h"
#import "FMDatabase.h"
@interface RootViewController ()
{
FMDatabase *_dataBase;
}
@end
@implementation RootViewController
- (id)initWithNibName:(NSString *)nibNa...
分类:
数据库 时间:
2015-08-18 22:56:56
阅读次数:
371
首先在工程里导入MapKit.framework 1 #import "RootViewController.h" 2 #import 3 @interface RootViewController () 4 5 @end 6 7 @implementation RootViewControl...
分类:
移动开发 时间:
2015-08-17 21:23:34
阅读次数:
146
#import "RootViewController.h"#define width [UIScreen mainScreen].bounds.size.width#define height [UIScreen mainScreen].bounds.size.height#define topH...
分类:
其他好文 时间:
2015-08-17 11:58:23
阅读次数:
132
设置几个类
AppDelegate
LTView
RootViewController
LoginViewController
RegistViewController
PasswordViewControllerAppDelegate.mapplication中
// 设置一个UIViewController
RootViewController *rootVC=[[RootViewC...
分类:
其他好文 时间:
2015-08-06 22:26:34
阅读次数:
236
- (void)restoreRootViewController:(UIViewController *)rootViewController{ typedef void (^Animation)(void); UIWindow* window = self.window; ...
分类:
其他好文 时间:
2015-08-06 00:07:24
阅读次数:
176
RootViewController.m
@interface
RootViewController ()UIScrollViewDelegate>
@property (nonatomic,
retain) UIPageControl *pageControl;
@property (nonatomic,
retain) UIScrollView...
分类:
其他好文 时间:
2015-08-05 16:18:23
阅读次数:
190
新建一个继承于UIViewController 的类
在AppDelegate.m 中写如下代码. //1.创建一个rootViewController对象
RootViewController *rootVC = [[RootViewController alloc]init];
//2.给window设置根视图控制器
self.window.rootViewContro...
分类:
其他好文 时间:
2015-08-04 23:06:48
阅读次数:
142
1.首先建立一个根视图控制器(引入头文件)原代码: // 设置根视图控制器
MainViewController *mainVC=[[MainViewController alloc] init];
_window.rootViewController =mainVC;
[mainVC release];2.在视图控制器中建立一个MyView的 UIView的子类(引入头文件...
分类:
移动开发 时间:
2015-08-03 22:52:28
阅读次数:
136
UIView支持触摸事件(因为继承于UIResponder),?而且?支持多 点触摸。需要定义UIView?子类,实现触摸相关的?方法。1.建立根视图控制器
原代码: // 设置根视图控制器
MainViewController *mainVC=[[MainViewController alloc] init];
_window.rootViewController =mainVC...
分类:
其他好文 时间:
2015-08-03 21:05:21
阅读次数:
132