启动的时候状态栏颜色是绿色的,,,是info里面的statusbar染色引起的。。。 df 领导:
==================另外demo也可以写多余的属性,读取的时候只会读名字一样的,只用于相似的几个页面。。。。。。。。。===========
--------上啦刷新,下拉加载更多看 MessageViewController 就行了。。。。。。
///下面两句的父类的两个属性。。。。。
@property (strong, nonatomic) NSMutableDictionary *myBaseDict; ///请求url的时候传入的参数。。
@property (strong, nonatomic) NSMutableArray *applications; ///返回的model的上一层。。
///一:Demo_Model
#import "ITTBaseModelObject.h"
@interface LiShiModel : ITTBaseModelObject
@property (nonatomic, strong) NSString *visitid;
@property (nonatomic, strong) NSString *company;
@property (nonatomic, strong) NSMutableArray *collaborative;
@end
#import "LiShiModel.h"
@implementation LiShiModel
- (NSDictionary*)attributeMapDictionary
{
return @{@"visitid":@"visitid", @"company":@"company", @"collaborative":@"collaborative"}; //后面的是网络的字段,前面的是属性名。
}
@end
///二:Demo_Request --------下面是post方法。。。。===get请求跟这一样,=在- (ITTRequestMethod)getRequestMethod 改成get就行了。传参还是用字典。===========
#import "ITTAFNBaseDataRequest.h"
@interface LiShiRequest : ITTAFNBaseDataRequest
@end
//http://192.168.1.8/zhongwei_api/index.php?m=ivisithistory&userid=3
#import "LiShiRequest.h"
#import "LiShiModel.h"
@implementation LiShiRequest
- (ITTRequestMethod)getRequestMethod
{
return ITTRequestMethodPost;
}
- (NSString*)getRequestUrl
{
return [NSString stringWithFormat:@"%@%@", [self getRequestHost], @"/zhongwei_api/index.php?m=ivisithistory"];
}
- (void)processResult
{
///不用继承父类,继承父类没有用的,还会起反作用。
NSArray *appdicArray = self.handleredResult[@"result"];
self.handleredResult2 = self.handleredResult;
self.result = [[ITTRequestResult alloc] initWithCode:@"0" withMessage:@""];
if (appdicArray && [appdicArray count]) {
NSMutableArray *applications = [NSMutableArray array];
for (NSDictionary *appdic in appdicArray) {
// for (NSDictionary *appdic2 in [appdic objectForKey:@"info"]) {
LiShiModel *application = [[LiShiModel alloc] initWithDataDic:appdic];
[applications addObject:application];
// [applications addObject:appdic2];
// }
}
self.handleredResult = [NSMutableDictionary dictionaryWithObjectsAndKeys:applications, KEY_APPLICATION, nil];
}
}
@end
///三:在viewcontroller里面用的时候。
@interface LIShiViewController : BaseViewController<UITableViewDataSource,UITableViewDelegate>
@property (strong, nonatomic) UITableView *myTableV;
@property (strong, nonatomic) NSMutableArray *myDataArray;
@property (strong, nonatomic)LiShiModel *lishiModel;
@end
///或者传一个字典,父类有一个字典。已经初始化了。并且 self.applications 是父类初始化好的一个数组。用来放model。
[LiShiRequest requestWithParameters:@{@"userid":[kUserDefault objectForKey:@"userid"]}
withIndicatorView:self.view
withCancelSubject:APPLICATION_LIST_REQUEST_CANCEL_SUBJECT
onRequestStart:^(ITTBaseDataRequest *request) {
}
onRequestFinished:^(ITTBaseDataRequest *request) {
if ([request isSuccess]) {
//成功的时候执行下面的方法。
if ([[request.handleredResult2 objectForKey:@"code"] intValue]==10) {
///如果不是表格形式的,可以用下句弹出请求成功的提示。
//[self.view.window showHUDWithText:[request.handleredResult objectForKey:@"msg"] Type:ShowPhotoYes Enabled:YES];
self.applications = request.handleredResult[KEY_APPLICATION];
///在tableview 里面 一一赋值给model就行了。。。。
[self.myTableV reloadData];
}else{
[ViewControllerFactory showMessageAlert:[request.handleredResult objectForKey:@"msg"]];
}
}else{
[ViewControllerFactory showMessageAlert:[request.handleredResult objectForKey:@"msg"]];
}
}
onRequestCanceled:^(ITTBaseDataRequest *request) {
}
onRequestFailed:^(ITTBaseDataRequest *request) {
[ViewControllerFactory showMessageAlert:@"请求失败!"];
}];
相关推荐
SuperKVC - iOS 轻量级 JSON 转 Model 框架,使用链式编程,无侵入
主要提供model框架,后续添加每一个接口,只需要复制。粘贴即可,
MVVM框架是一个 Model-View-View Model框架,其中 ViewModel连接模型Model)和视图(View)。 在数据操作比较多的场景中,MVVM框架更合适,有助于通过操作数据渲染页面。 2、active- class是哪个组件的属性? 它是 ...
| – model 框架数据库模型目录 | – modules 框架模块目录 | – templates 框架系统模板目录 | – phpsso_server phpsso主目录 | – statics 系统附件包 | – css 系统css包 | – images 系统图片包 | – js...
| – model 框架数据库模型目录 | – modules 框架模块目录 | – templates 框架系统模板目录 | – phpsso_server phpsso主目录 | – statics 系统附件包 | – css 系统css包 | – images 系统图片包 | – js...
在.NET MVC中,当页面提交model到Action的时候,自动填充ModelState。使用ModelState.IsValid进行方便快捷的数据验证,其验证也是调用命名空间System.ComponentModel.DataAnnotations和System.ComponentModel中的...
基于Anti-model测试思想,设计出基于Anti-model的测试框架,详细分析和说明了Anti-model的测试过程中的几个关键性的技术,包括动态数据的获得、动态数据的存储格式、综合行为模型、修正和精炼系统行为模型、再测试的...
Maverick是一个轻量而完备的MVC Model 2框架。Maverick的Action称作Controller。Controller只接受一个ControllerContext参数。request,response, servlet config, servelt context等输入信息都包装在...
EntityModel基础框架中包含的配置项说明1
AFN框架的二次封装以及JSON与Model的转化
该源码案例是一款不错的JSON和Model转换框架,源码MJExtension,MJExtension是JSON和Model转换最快、最方便以及最易用的框架。 功能 JSON --> Model JSONString --> Model Model --> JSON JSON Array -->...
1. MVC框架技术:MVC框架技术是最早的Web前端框架技术之一,它将应用程序分为Model、View和Controller三个部分。MVC框架技术的优点是结构清晰、易于维护,缺点是需要较高的开发经验。 2. MVVM框架技术:MVVM框架...
Struts 框架之构建 Model组件.rar
ASP.NET 三层框架搭建 BLL+IDAL+DAL+DB+MODEL 通用性很强直接可以使用。
藏经阁-ui-model,跨框架复用.pdf
一、功能介绍QMVC 是高性能 MVC 框架,Q是Quick的缩写,MVC分别为Model、Controller、View的缩写。QMVC使用C#程序语言开发,采用Microsoft .NET framework 4.5类库,是用于B/S结构项目开发。QMVC项目的作者吾修师傅...
压缩包为ssm框架样例,解压后倒入maven工程可用,包括数据库建表,pom依赖,spring,mybatis,springMVC整合配置文件,mybatis逆向工程生成代码
SpringBoot框架 实体类(Model类)生成工具 for MySQL 需要.netframework4支持,如果无法运行,请自行安装.netframework4。推荐下载搜索关键字 dotNetFx40_Full_x86_x64.exe 说明:由于这是自写自用的工具,功能还...
关于前端开发框架vue中的v-model双向绑定自定义组件(第二版)
Objective-C Model、JSON、NSDictionary互相转换简单高效的轻量级框架,支持model嵌套model。 Features GenericModel 支持Objective-C Model、NSDictionary、JSON之间互相转换,框架非常简单高效,内部对反射过的...