tableView的小节
来源:互联网 发布:mysql入门经典 编辑:程序博客网 时间:2024/06/04 18:07
1.逻辑传值:
A--->B(方法和属性)
B---->A (协议)
1.1.属性传值:
定义属性——设置中间值——给中间值赋值——调用中间
SecondViewController *second = [[SecondViewController alloc] initWithNibName:nil bundle:nil];
second.currentValue = _mainTableArray[indexPath.row];
-(void)sendMessage:(NSString *)str1{
self.currentValue = str1;
}
-(void)viewWillAppear:(BOOL)animated{
for (int i=0 ;i<_tableArray.count ; i++) {
NSDictionary *dic = [_tableArray objectAtIndex:i];
NSString *str = [dic objectForKey:@"name"];
if ( [str isEqualToString:self.currentValue]) {
} else {
[_tableArray removeObjectAtIndex:i];
[_table reloadData];
}
}
}
@property(nonatomic,retain)NSString * currentValue;
-(void)sendMessage:(NSString *)str;
-(void)sendMessage:(NSString *)str1{
self.currentValue = str1;
}
-(void)viewWillAppear:(BOOL)animated{
for (int i=0 ;i<_tableArray.count ; i++) {
NSDictionary *dic = [_tableArray objectAtIndex:i];
NSString *str = [dic objectForKey:@"name"];
if ( [str isEqualToString:self.currentValue]) {
} else {
[_tableArray removeObjectAtIndex:i];
[_table reloadData];
}
}
}
@protocol SecondView;
@property(nonatomic,assign)id<SecondView>delegate;
@protocol SecondView <NSObject>
-(void)firstGetMessage:(NSString *)value;
@end
-(void)change:(id)sender{
[self.delegate firstGetMessage:_field.text];
[self.navigationController popToRootViewControllerAnimated:YES];
}
//方法获得从a界面传入的内容
-(void)sendMessage:(NSString *)str{
self.currentValue = str;
}
@interface MainViewController ()<SecondView>
- tableView的小节
- phpstorm的一些小节
- 关于BFS的小节
- 小节
- 小节
- STL中 迭代器的小节
- Symbian的体系架构小节
- 关于sleep函数的小节
- IOS NSIndexSet的使用小节
- ios 数据库的创建小节
- UIKit-TableView--简单的TableView
- 对Spring的BeanFactory的学习小节
- 对Spring的BeanFactory的学习小节
- Spring的BeanFactory的学习小节
- 对Spring的BeanFactory的学习小节
- 几个常用的Ajax库小节
- 对摄像头编程的研究小节
- Solaries9 Oracle9i安装注意的一些小节
- sql server 2008 win7下安装检查,重启计算机 失败
- Android项目打第三方jar包
- 浅谈-----多线程(一)
- 下一个云计算的大事件:谷歌拥抱Docker
- 设计模式——命令模式
- tableView的小节
- C陷阱与缺陷之语法陷阱
- CentOS minimal笔记(一):第一次进系统
- 编译Boost 详细步骤 适用 VC6 VS2003 VS2005 VS2008 VS2010
- 第一次实验——八皇后问题
- Python中常用字符串 函数
- 一、排序算法 归并排序
- 简单使用Google*谷歌搜索和gmail的方法
- 学拳录 19双推掌