Common

简介: Common

1364549968_3376.png

1.下拉刷新

 [self.m_luntanTable addPullToRefreshWithActionHandler:^{
        NSLog(@"refresh dataSource");
        [self.m_luntanTable.pullToRefreshView performSelector:@selector(stopAnimating) withObject:nil afterDelay:2];
        [self performSelectorOnMainThread:@selector(InitThreadFunc:) withObject:nil waitUntilDone:NO];
    }];
    // trigger the refresh manually at the end of viewDidLoad
    [self.m_luntanTable.pullToRefreshView triggerRefresh];

2.转圈等待

-(void)SetHUD
{
    HUD = [[MBProgressHUD alloc] initWithView:self.navigationController.view];
    [self.m_BaseScroll addSubview:HUD];
    HUD.delegate = self;
    HUD.labelText = @"加载中";
    [HUD showWhileExecuting:@selector(myTask) onTarget:self withObject:nil animated:YES];
}

3.启动网络监听和更新版本检查

 listenNetwork = [[zzListenNetworkAndTestVersionUpdate alloc]init];
    listenNetwork.delegate = self;
    [listenNetwork SetListenNetWork:622493449 storeUrl:@"https://itunes.apple.com/us/app/xing-ke-hui/id622493449?ls=1&mt=8"];//622493449//588927533
    [listenNetwork GetBeginNetWork];

4.zip压缩NSString

-(void)ZipString
{
    NSString *str = @"{我是中国人我是中国人我是中国人我是中国人我是中国人我是中国人我是中国人我是中国人我是中国人我是中国人我是中国人我是中国人我是中国人我是中国我是中国人我是中国人我是中国人我是中国人我是中国人我是中国人我是中国人我是中国人我是中国人我是中国人我是中国人我是中国人我是中国人我是中国人我是中国人我是中国人我是中国人我是中国人我是中国人我是中国人我是中国人我是中国人我是中国人我是中国人我是中国人我是中国我是中国人我是中国人我是中国人我是中国人我是中国人我是中国人我是中国人我是中国人我是中国人我是中国人我是中国人我是中国人我是中国人我是中国人我是中国人我是中国人我是中国人我是中国人我是中国人我是中国人我是中国人我是中国人我是中国人我是中国人我是中国人我是中国我是中国人我是中国人我是中国人我是中国人我是中国人我是中国人我是中国人我是中国人我人}";
    ///string  转data
    NSData *data = [str dataUsingEncoding:NSUTF8StringEncoding];
    //data zip压缩
    data = [LFCGzipUtillity gzipData:data];
    //data base64编码
    str =[data base64EncodingWithLineLength:0];
    //base64转data
    data = [NSData dataWithBase64EncodedString:str];
    //data 解压缩
    data = [LFCGzipUtillity uncompressZippedData:data];
    //data转string
    str = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
    //输出string
    NSLog(str);
}

5.图片高斯模糊

 [self.headBackImg setImageToBlur:[UIImage imageNamed:@"detail_bj.png"]
                        blurRadius:kLBBlurredImageDefaultBlurRadius
                   completionBlock:^(NSError *error){
                       NSLog(@"The blurred image has been setted");
                   }];
相关文章
|
IDE 开发工具
Unable to load class ‘org.gradle.api.internal.plugins.DefaultConvention‘
Unable to load class ‘org.gradle.api.internal.plugins.DefaultConvention‘
1150 0
com.google.common.base.Preconditions.checkNotNull(Preconditions.java:877)
com.google.common.base.Preconditions.checkNotNull(Preconditions.java:877)
67 0
Could not find com.serenegiant:common:4.1.1
Could not find com.serenegiant:common:4.1.1
198 0
Unable to load class 'org.gradle.api.internal.component.Usage
Unable to load class 'org.gradle.api.internal.component.Usage
87 0
|
算法 Python
包引入报错 ImportError: cannot import name ‘best_partition‘ from ‘community‘
包引入报错 ImportError: cannot import name ‘best_partition‘ from ‘community‘
包引入报错 ImportError: cannot import name ‘best_partition‘ from ‘community‘
|
Python
安装docx后,import提示Import Error: No module named ‘exceptions‘
安装docx后,import提示Import Error: No module named ‘exceptions‘
246 0
JavaWeb - Common 之 Const
JavaWeb - Common 之 Const
85 0
【Unity3D 问题总结】Failed to import package with error: Couldn‘t decompress package
报错问题:Failed to import package with error: Couldn’t decompress package 今天在导入一个资源包的时候突然提示报错:Failed to import package with error: Couldn’t decompress package
【Unity3D 问题总结】Failed to import package with error: Couldn‘t decompress package
|
Java
Missing artifact net.sf.json-lib:json-lib:jar:2.4
版权声明:本文为 testcs_dn(微wx笑) 原创文章,非商用自由转载-保持署名-注明出处,谢谢。 https://blog.csdn.net/testcs_dn/article/details/79911266 添加依赖 net.
1477 0
|
Android开发 Spring
An internal error occurred during: "Building UI model". com/google/common/base/Function
版权声明:本文为 testcs_dn(微wx笑) 原创文章,非商用自由转载-保持署名-注明出处,谢谢。 https://blog.csdn.net/testcs_dn/article/details/78798610 ...
1541 0