zoukankan      html  css  js  c++  java
  • ios中常用的方法

    图片分类
    
    @implementation UIImageView (ext)
    
     
    
     
    
    +(UIImageView*)imageViewWith:(UIImage*)img imgFrame:(CGRect)_rect{
    
        UIImageView *imgView = [[[UIImageViewalloc] initWithFrame:_rect] autorelease];
    
        imgView.image = img;
    
        return imgView;
    
    }
    
    //图片拉绳 
    
    + (UIImageView *)imageViewForResizableImage:(UIImage *)image inRect:(CGRect)rect
    
    {
    
        UIImageView *imageView = [[[UIImageViewalloc] initWithFrame:rect] autorelease];
    
        imageView.userInteractionEnabled = YES;
    
        if ([image respondsToSelector:@selector(resizableImageWithCapInsets:)]) {
    
            imageView.image = [image resizableImageWithCapInsets:UIEdgeInsetsMake(image.size.height/2, image.size.width/2, image.size.height/2, image.size.width/2)];
    
        } else {
    
            imageView.image = [image stretchableImageWithLeftCapWidth:image.size.width/2 topCapHeight:image.size.height/2];
    
        }
    
        return imageView;
    
    }
    
     
    
     
    
    @end
    用block快速创建一个block 
    
    +(XPNetWork*)shareNetWork{
        static XPNetWork *network = NULL;
        
        static dispatch_once_t onceToken;
        dispatch_once(&onceToken, ^{
            network = [[self alloc] init];
        });
        return network;
    }
    
    UITableviewCell进行分组的
    一个集合(NSArrary)包含多个个集合(NSArray  addobject:nsarrary]。section
    一个集合包含 多个字典( nsarrary add object :字典】 row
    
    赋值的时候
    
    //self.mydata是最大集合
    NSArray *sectionArray=self.mydata[indexPath.section];//得到组 section
    NSDictionary *resDic=sectionArray[indexPath.row];//得到row.
    //通过字典进行赋值。
    NSString *keySt = [NSString stringWithFormat:@"%@:",[[resDic allKeys] objectAtIndex:0]];
                    NSString *valueSt = [[resDic allValues] objectAtIndex:0];
  • 相关阅读:
    遗传算法求函数最值(C语言实现)
    AjaxUploader使用
    AjaxUploader使用:FileUploaded及UploadCompleted
    AutoIt
    网站盗链问题及解决方案
    input不保留历史记录
    必备知识:消息处理
    AjaxUploader使用:文件保存到数据库
    AjaxUploader使用:JavaScript APIs
    页面定时跳转
  • 原文地址:https://www.cnblogs.com/gcb999/p/3161336.html
Copyright © 2011-2022 走看看