zoukankan      html  css  js  c++  java
  • [某鸥实训记][objective-c][第六天][个人笔记]

    - -..抓了个请求什么什么包的网址...然后发了个什么什么请求...

     

    用了个叫paros的工具 

     

    ip设置成电脑的..设置下端口...然后把移动设备的HTTP代理设置成一样的就能抓了=w=

    抓完了以后..又用了个什么什么包...往刚才抓的网址发了个请求..然后接收了一下Responce..

    //PictureURLRequest.h
    #import <Foundation/Foundation.h>
    
    @protocol PictureURLRequestDelegate <NSObject>
    - (void)loadData;
    @end
    
    @interface PictureURLRequest : NSObject
    
    @property (nonatomic,weak)id <PictureURLRequestDelegate> delegate;
    @property (nonatomic,strong) NSMutableArray *mArr;
    
    -(instancetype)init;
    
    @end
    
     
    
    //PictureURLRequest.m
    #import "PictureURLRequest.h"
    #import "URLParsing.h"
    #import "Network.h"
    #import "PictureModel.h"
    
    @implementation PictureURLRequest
    
     
    -(instancetype)init{
        self = [super init];
        if (self) {
            Network *net = [[Network alloc] init];
            [net asynGetNetworkWith:[NSURL URLWithString:@"http://c.m.163.com/photo/api/list/0096/4GJ60096.json"] block:^(id data) {
                NSArray *arr = [NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingMutableContainers error:nil];
                _mArr = [[NSMutableArray alloc] initWithCapacity:10];
                for (NSDictionary *dic1 in arr) {
                    PictureModel *pictureModel = [[PictureModel alloc] init];
                    [pictureModel setValuesForKeysWithDictionary:dic1];
                    [_mArr addObject:pictureModel];
                }
                [self.delegate loadData];
            }];
        }
       return self;
    }
    @end
     
    
    //PictureModel中只有几个属性

    然后用了SDWebImage去从网上获取图片..

    #import "UIImageView+WebCache.h"

    然后

    [self.clientcoverImageView sd_setImageWithURL:[NSURL URLWithString:model.clientcover]];

    就行了=w=..

  • 相关阅读:
    子类继承方法的重写
    操作系统的用户模式和内核模式
    Java中的CAS
    FaceBook SDK登录功能实现(Eclipse)
    eclipse集成ijkplayer项目
    android handler传递数据
    android发送短信
    hadoop中的job.setOutputKeyClass与job.setMapOutputKeyClass
    mysql对事务的支持
    使用jd-gui+javassist修改已编译好的class文件
  • 原文地址:https://www.cnblogs.com/NyaSu/p/4809758.html
Copyright © 2011-2022 走看看