首页
学习
活动
专区
圈层
工具
发布
    • 综合排序
    • 最热优先
    • 最新优先
    时间不限
  • 来自专栏君赏技术博客

    开发获取`NSURL`字符串的参数

    ---- typora-copy-images-to: ipic 开发获取NSURL字符串的参数 因为今天要获取返回的CallBack返回URL字符串后拼接的字符串 发现NSURL这个类里面没有什么API 我就顺着NSURL所在的文件向下面找去。 ? 78658C40-E92C-4D03-9426-8717F9B32209 图片的两个参数引起我的注意,我就全局搜索NSURLQueryItem那地方有。 我直接用我的NSURL的变量获取queryItems的发现没有这个属性,仔细一看原来是归属于NSURLComponents这个类。 我们就初始化一个这个类写一下代码看看。 NSURL *url = [NSURL URLWithString:@"http://www.xxxx.com?

    1.9K20发布于 2018-08-31
  • 来自专栏韦弦的偶尔分享

    WKWebView 加载 Uni-App 导出的本地 H5

    index" ofType:@"html" inDirectory:@"h5"]; NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL *baseUrl = [NSURL fileURLWithPath:pathString]; NSURL *loadUrl = [NSURL URLWithString:pathString2 *baseUrl = [NSURL fileURLWithPath:pathString]; NSURL *loadUrl = [NSURL URLWithString:pathString2 *loadUrl = [NSURL URLWithString:loadPath relativeToURL:baseUrl]; [self.webView loadFileURL: loadUrl allowingReadAccessToURL:[NSURL fileURLWithPath: [paths objectAtIndex:0]]]; } iOS 加载Uni-APP 效果

    1.5K30编辑于 2022-09-21
  • 来自专栏大师级码师

    ASI框架使用全集讲解

    ; // 6ASI 下载 // [self _downLoad]; // 7ASI 上传 [self _upLoad]; } //同步get请求 (void)_synGet{ NSURL * url=[NSURL URLWithString:@"http://localhost/logo.php? * url=[NSURL URLWithString:@"http://localhost/logo.php? * url=[NSURL URLWithString:@"http://localhost/logo.php? * url=[NSURL URLWithString:@"http://localhost/test.rar"]; //1 封装请求 ASIHTTPRequest * request=[

    53900发布于 2021-10-31
  • 来自专栏一“技”之长

    SDWebImage源码分析 原

    SDWebImageManager *)manager NS_DESIGNATED_INITIALIZER; //进行预下载 - (void)prefetchURLs:(nullable NSArray<NSURL //当前状态的图片URL - (nullable NSURL *)sd_currentImageURL; //获取指定状态的图片URL - (nullable NSURL *)sd_imageURLForState )state; - (void)sd_setBackgroundImageWithURL:(nullable NSURL *)url forState :(nullable NSURL *)url placeholderImage:(nullable UIImage *)placeholder options:(SDWebImageOptions)options; - (void)sd_setImageWithURL:(nullable NSURL *)url

    1.2K30发布于 2018-08-15
  • 来自专栏月亮与二进制

    iOS应用调用系统打电话、发短信和发邮件功能引1、打电话2、发短信3、发邮件

    UIWebView *callWebview =[[UIWebView alloc] init]; NSURL *telURL =[NSURL URLWithString:[NSString stringWithFormat NSURL *telURL =[NSURL URLWithString:[NSString stringWithFormat:@"tel:%@",self.phoneNumber.text]]; [ UIWebView *smsWebview =[[UIWebView alloc] init]; NSURL *telURL =[NSURL URLWithString:[NSString stringWithFormat NSURL *telURL =[NSURL URLWithString:[NSString stringWithFormat:@"sms:%@",self.phoneNumber.text]]; [ 的方式,与打电话、发短信都是一样的,要改的也是URL中要以“mailto:”开头,后接邮箱地址: UIWebView *emailWebview =[[UIWebView alloc] init]; NSURL

    4.8K50发布于 2021-11-23
  • 来自专栏娱乐心理测试

    两个app应用之间的跳转

    在IOS中有一个专门用于包装资源路径的类——NSURL。 一个完整URL的组成 例如:http://123.0.0.1/path? page=100 “http://”:协议类型 “123.0.0.1”:服务器ip地址 “/path”:资源存放的是路径 “page=100”:请求的参数 NSURL包装一个完整地址 NSURL *url = [NSURL URLWithString:@"http://123.0.0.1/path? *)url; 它的一些我们非常熟悉的用法: //拨打系统电话 NSURL *url = [NSURL URLWithString:@"tel://10086"]; [[UIApplication sharedApplication] openURL:url]; //发送系统短信 NSURL *url = [NSURL URLWithString:@"sms://1383838438"];

    3.5K30发布于 2018-07-05
  • 来自专栏iOS开发~

    iOS_调起各个地图软件

    preferredStyle:UIAlertControllerStyleActionSheet]; for (int i = 0; i < mapSchemeArr.count; i++) { NSURL *url = [NSURL URLWithString:mapSchemeArr[i]]; if ([[UIApplication sharedApplication] canOpenURL: *url = [NSURL URLWithString:urlString]; if ([[UIApplication sharedApplication] canOpenURL:url]) *url = [[NSURL alloc] initWithString:urlString]; if ([[UIApplication sharedApplication] canOpenURL *url = [[NSURL alloc] initWithString:urlString]; if ([[UIApplication sharedApplication] canOpenURL

    52310编辑于 2022-07-20
  • 来自专栏DannyHoo的专栏

    iOS开发中利用AFNetworking下载大文件以及下载文件的删除

    创建下载路径和请求对象 NSURL *URL = [NSURL URLWithString:@"http://dldir1.qq.com/qqfile/QQforMac/QQ_V5.4.0.dmg" 第三个参数 - destination:自动完成文件剪切操作      *      其中: 返回值:该文件应该被剪切到哪里      *            targetPath:临时路径 tmp NSURL *(NSURL *targetPath, NSURLResponse *response) { // 文件下载路径 我们下载的大文件如视频应该放在沙盒的Library文件下 NSString 创建一个空的文件         [fileManager createFileAtPath:filePathStr contents:nil attributes:nil]; //        NSURL NSDocumentDirectory inDomain:NSUserDomainMask appropriateForURL:nil create:NO error:nil]; //        NSURL

    4K20发布于 2018-09-13
  • 来自专栏用户4669341的专栏

    IOS开发:直播系统中视频播放功能实现

    *url = [NSURL fileURLWithPath:urlString]; return url; } // 网络视频 - (NSURL *)getNetworkUrl{ NSString = @"http://svideo.spriteapp.com/video/2016/0914/4cb325f6-7a09-11e6-a458-d4ae5296039d_wpd.mp4"; NSURL *url = [NSURL URLWithString:[urlString stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding *url = [NSURL fileURLWithPath:urlString]; return url; } // 网络视频 - (NSURL *)getNetworkUrl{ NSString *url = [NSURL URLWithString:[urlString stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding

    1.9K30发布于 2019-03-06
  • 来自专栏iOS开发笔记

    iOS开发+(nullable instancetype)URLWithString:(NSString *)URLString

    项目中刚开始写的是如下的方法,地址中无中文 NSString *string = @"http://101.201.150.217:8080/map-web/bbsImageFiles/11.png"; NSURL *url = [NSURL URLWithString:string]; 在这里能正确得到URL,并进行图片的下载。 *url = [NSURL URLWithString:string]; 打印发现得到的URL地址为nil。 解决方法: NSString *string = @"http://101.201.150.217:8080/map-web/bbsImageFiles/天气.png"; NSURL *url = [NSURL URLWithString:[string stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet

    95670发布于 2019-05-15
  • 来自专栏陈满iOS

    iOS开发·第三方网络下载处理框架:AFNetworking网络下载处理(官方文档翻译篇)

    AFURLSessionManager *manager = [[AFURLSessionManager alloc] initWithSessionConfiguration:configuration]; NSURL *URL = [NSURL URLWithString:@"http://example.com/download.zip"]; NSURLRequest *request = [NSURLRequest *(NSURL *targetPath, NSURLResponse *response) { NSURL *documentsDirectoryURL = [[NSFileManager defaultManager URLByAppendingPathComponent:[response suggestedFilename]]; } completionHandler:^(NSURLResponse *response, NSURL :URL]; NSURL *filePath = [NSURL fileURLWithPath:@"file://path/to/image.png"]; NSURLSessionUploadTask

    96730发布于 2018-09-10
  • 来自专栏滕先生的博客

    SDWebImage 图片下载缓存框架 常用方法及原理

    1、获取当前图片的地址 - (NSURL *)sd_imageURL; 2、下载网络图片并缓存 - (void)sd_setImageWithURL:(NSURL *)url; - (void)sd_setImageWithURL :(NSURL *)url placeholderImage:(UIImage *)placeholder; - (void)sd_setImageWithURL:(NSURL *)url placeholderImage UIImage *)placeholder options:(SDWebImageOptions)options; 下载图片的线程执行完后回调 - (void)sd_setImageWithURL:(NSURL *)url completed: (SDWebImageCompletionBlock)completedBlock; - (void)sd_setImageWithURL:(NSURL *)url *url = [NSURL URLWithString:@"http://picview01.baomihua.com/photos/20120624/m_14_634761470842343750_

    3.6K40发布于 2018-05-18
  • 来自专栏日常技术分享

    SDWebImage downloadImageWithURL 换成loadImageWithURL

    //老版本 [[SDWebImageManager sharedManager]downloadImageWithURL:[NSURL URLWithString:@""] options:0 progress expectedSize) { } completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType, BOOL finished, NSURL *imageURL) { }]; //4.0 版本 [[SDWebImageManager sharedManager] loadImageWithURL:[NSURL URLWithString: [imageArray objectAtIndex:i]] options:0 progress:^(NSInteger receivedSize, NSInteger expectedSize, NSURL image, NSData * _Nullable data, NSError * _Nullable error, SDImageCacheType cacheType, BOOL finished, NSURL

    1.1K10编辑于 2021-12-16
  • 来自专栏一“技”之长

    iOS第三方文件压缩框架——Godzippa 原

    autoreleasing *)error;     NSFileManager类别中提供的方法如下: //压缩文件并写入磁盘 返回值确定压缩操作是否成功 - (BOOL)GZipCompressFile:(NSURL *)sourceFile writingContentsToFile:(NSURL *)destinationFile error:(NSError * _ _autoreleasing *)error; //进行文件压缩,支持配置压缩级别 - (BOOL)GZipCompressFile:(NSURL *)sourceFile writingContentsToFile :(NSURL *)destinationFile atLevel:(int)level error:(NSError *__autoreleasing *)error; //进行文件的解压缩 - (BOOL)GZipDecompressFile:(NSURL *)sourceFile writingContentsToFile:(NSURL

    97810发布于 2018-08-15
  • 来自专栏進无尽的文章

    基础篇-应用之间的跳转

    A中如此跳转设置 if ( [[UIApplication sharedApplication]canOpenURL:[NSURL URLWithString:@"nihao://"]]) { [[UIApplication sharedApplication]openURL:[NSURL URLWithString:@"nihao://"]]; }else{ NSLog(@" :@"nihao://one"]]) { [[UIApplication sharedApplication]openURL:[NSURL URLWithString:@"nihao://one "]]; }else{ NSLog(@"未安装"); } B中如此的设置 - (BOOL)application:(UIApplication *)application openURL:(NSURL URLWithString:oneUrlScheme]]) { [[UIApplication sharedApplication]openURL:[NSURL URLWithString

    1.1K10发布于 2018-09-12
  • 来自专栏TechBox

    WSRouter—一款轻量级路由跳转框架

    如果你对URL中的scheme、host、path、query等URL的各个部分不甚了解,下面的例子可以帮助你: NSURL *url = [NSURL URLWithString:@"ws://www.ws.com :url handler:^UIViewController *(NSURL *URL, UIViewController *sourceViewController) { // 实例化控制器 [WSRouter transferFromViewController:self toURL:[NSURL URLWithString:@ 如下: + (void)registerRouter { NSURL *url = [NSURL URLWithString:@"WS://www.ws.com/second"]; [WSRouter web=1&uid=999 NSURL *url = [NSURL URLWithString:@"ws://www.ws.com/third"]; [WSRouter registerRouterWithPrefixURL

    7.3K30发布于 2019-10-08
  • 来自专栏学海无涯

    iOS开发之UICollectionViewDataSourcePrefetching

    , UICollectionViewDataSourcePrefetching> //下载图片任务 @property(nonatomic, strong) NSMutableDictionary<NSURL *, dispatch_queue_t> *tasks; //图片地址 @property(nonatomic, copy) NSMutableArray<NSURL *> *imgURLArray; //下载的图片 @property(nonatomic, copy) NSMutableDictionary<NSURL *, UIImage *> *imgs; //UICollectionView *imgURL = [NSURL URLWithString:@"https://timgsa.baidu.com/timg? ]; } } return _imgURLArray; } //懒加载imgs -(NSMutableDictionary<NSURL

    2.6K60发布于 2018-05-03
  • 来自专栏LeeCen

    AFNetworking的使用

    获取信息 -(void)getRequestWithUrl:(NSString *)urlString WithParameters:(NSDictionary *)dictionary { NSURL *url = [NSURL URLWithString:urlString]; AFHTTPSessionManager *manager = [AFHTTPSessionManager manager manager.responseSerializer.acceptableContentTypes = [NSSet setWithObjects:@"application/json", nil]; NSURL *url = [NSURL URLWithString:urlString]; [manager POST:url.absoluteString parameters:dictionary progress manager.responseSerializer.acceptableContentTypes = [NSSet setWithObjects:@"application/json", nil]; NSURL

    1.5K10发布于 2018-10-11
  • 来自专栏iOSer成长记录

    SDWebImage 源码阅读(缓存)

    // 获取默认的缓存路径 NSString *cachePathForKey = [self defaultCachePathForKey:key]; // 将路径转为url NSURL *fileURL = [NSURL fileURLWithPath:cachePathForKey]; // 将图片数据写入文件,并保存 [imageData writeToURL:fileURL *keyURL = [NSURL URLWithString:key]; NSString *ext = keyURL ? *diskCacheURL = [NSURL fileURLWithPath:self.diskCachePath isDirectory:YES]; NSArray<NSString 当前所有缓存的大小 NSUInteger currentCacheSize = 0; // 存储需要移除的缓存图片的路径 NSMutableArray<NSURL

    1.5K30发布于 2018-06-13
  • 来自专栏Scott_Mr 个人专栏

    两个App之间调起通信

    Test2是在Test2这个项目的info.plist中配置的URL Schemes if ([[UIApplication sharedApplication] canOpenURL:[NSURL URLWithString:@"Test2://"]]) { [[UIApplication sharedApplication] openURL:[NSURL URLWithString } return YES; } - (BOOL)application:(UIApplication *)application handleOpenURL:(NSURL Test2工程中测试代码 - (BOOL)application:(UIApplication *)application handleOpenURL:(NSURL *)url { URLWithString:@"Test1://"]]) { [[UIApplication sharedApplication] openURL:[NSURL URLWithString

    77310发布于 2018-07-05
领券