YIem`s Blog -心比天高命比纸薄-链接找不到的请在站内搜索内容!

iOS-UI-JOSN数据解析-系统方法





//
// ViewController.m
// JOSN解析
//
// Created by YIem on 16/2/29.
// Copyright © 2016年 YIem. All rights reserved.
//

import "ViewController.h"

import "Student.h"

import "JSONKit.h"

@interface ViewController ()
@property (nonatomic, retain) NSMutableArray *stuArr;
@end

@implementation ViewController


NSLog(@"%@", arr);
self.stuArr = [NSMutableArray array];
for (NSDictionary *dic in arr) {
    Student *stu = [[Student alloc] init];
    [stu setValuesForKeysWithDictionary:dic];
    [self.stuArr addObject:stu];
}

}

@end



//
// Student.h
// JOSN解析
//
// Created by YIem on 16/2/29.
// Copyright © 2016年 YIem. All rights reserved.
//

import <Foundation/Foundation.h>

@interface Student : NSObject
@property (nonatomic, copy) NSString *number;
@property (nonatomic, copy) NSString *name;
@property (nonatomic, copy) NSString *sex;
@property (nonatomic, copy) NSString *phone;
@end


//
// Student.m
// JOSN解析
//
// Created by YIem on 16/2/29.
// Copyright © 2016年 YIem. All rights reserved.
//

import "Student.h"

@implementation Student

@end

当前页面是本站的「Google AMP」版。查看和发表评论请点击:完整版 »