Objective-C之foundation框架中的NSString的使用方法、指针基本用法、读取本地和远程文件

【NSString字符串的截取 Objective-C语言】 NSString字符串的截取 Objective-C语言 阅读详情

创建NSString的方法:

NSString *str1 = @"Hello World";
NSString *str2 = [[NSString alloc] init];
str2 = @"Hello World";
[str2 release];

NSString *str3 = [[NSString alloc] initWithString:@"Hello World"];
[str3 release]; //内存被回收,但是变量可改变指针位置,继续使用该变量
str3 = [NSString stringWithString:@"hello"]; //这种方法不需要管理内存,因为它引用的是NSString的静态方法


//传入C语言中的字符串,转成OC字符串
NSString *str4 = [[NSString alloc] initWithUTF8String:"Hello World"];
[str4 release];
str4 = [NSString stringWithUTF8String:"hello"]; //这种方法不需要管理内存,因为它引用的是NSString的静态方法

//格式化    %.2f:float类型的,保留两位小数
NSString *str5 = [[NSString alloc] initWithFormat:@"my age is %i and height is %.2f", 25, 1.76f];
[str5 release];
str5 = [NSString stringWithFormat:@"hello"]; //这种方法不需要管理内存,因为它引用的是NSString的静态方法


以下方式存在内存泄露
//格式化    %.2f:float类型的,保留两位小数
//[[NSString alloc] initWithFormat:@"my age is %i and height is %.2f", 25, 1.76f]; 没有被释放
NSString *str5 = [[NSString alloc] initWithFormat:@"my age is %i and height is %.2f", 25, 1.76f];
//[NSString stringWithFormat:@"hello"];是自动释放的,不应该在运行[str5 release] 来释放内存
str5 = [NSString stringWithFormat:@"hello"]; 
[str5 release]; //野指针错误


下面是demo代码:
demo主要演示指向指针的指针、读取远程、本地文件内容的方法


#import <Foundation/Foundation.h>

void  test(){
   NSString *path = @"/Users/gongpb/develop/NSString/NSString/test.txt";
   
    //过期方法,不能读取中文
   NSString *str = [NSString stringWithContentsOfFile:path];
   NSLog(@"text.txt content is :%@",str);
  
   NSString *str1 = [NSString stringWithContentsOfFile:path encoding:NSUTF8StringEncoding error:nil];
   NSLog(@"test.txt content is :%@",str1);
   
   /**
    这种异常机制不经常使用
    @try {
    }
    @catch (NSException *exception) {
    }
    @finally {
    }
    **/
    NSError *error;
    //error:(NSError **)error;   **代表指向指针的指针
    NSString *str2 = [NSString stringWithContentsOfFile:path
                    encoding:kCFStringEncodingGB_18030_2000  error:&error];
    if (error==nil) {
        NSLog(@"success");
    }else{
        NSLog(@"error : %@",error);
    }
    NSLog(@"text.txt content is 2:%@",str2);

    //  file:// 这两个反斜杠是固定的,USers前边的一个反斜杠 是代表跟路径
    NSURL *url = [NSURL URLWithString:@"file:///Users/gongpb/develop/NSString/NSString/test.txt"];
    NSString *urlStr1 = [NSString stringWithContentsOfURL:url
                                                 encoding:NSUTF8StringEncoding error:nil];
    NSLog(@"url content is :%@",urlStr1);
   
    //remote  url
    NSURL *remoteUrl = [NSURL URLWithString:@"http://www.baidu.com"];
    NSString *remoteStr = [NSString stringWithContentsOfURL:remoteUrl
                                              encoding:NSUTF8StringEncoding error:nil];
    NSLog(@"remote url content is: %@",remoteStr);
   
}

void test1(NSString *str){
    str=@"123";
}

void test2(NSString **str){
    (*str) = @"456";
}

 

 


#pragma mark 字符串导出
void stringExport(){
    NSLog(@"--------export--------");
    NSString *str = @"123456";
    NSString *path = @"/Users/gongpb/develop/NSString/NSString/abc.txt";
    NSError *error;
    [str writeToFile:path atomically:YES encoding:NSUTF8StringEncoding error:&error];
   
    if(error ==nil){
        NSLog(@"success");
    }else{
       
        NSLog(@"error:%@", [error localizedDescription]);
    }   
}

int main(int argc, const char * argv[])
{

    @autoreleasepool {
       
        test();
        //指针变量存的是地址
        NSString *s = nil;
        test1(s);  //不能改变s的值
        NSLog(@"s value=%@",s);
       
        //point  &s传入s的地址
        test2(&s);
        NSLog(@"age is %@",s);

 

    //导出
   stringExport();        


    }
    return 0;
}

通过NSString和NSData将数据写入文件 最近在学Objective-C,来做iOS开发,会陆陆续续把学习的内容补充完整。 一 将NSString对象写入文件   在将字符串对象写入文件时,要指定字符串编码。字符串编码的作用是描述字符和代表字符的数字之间的映射关系。在ASCII码中,字符“A”对应01000001.在UTF-16编码中,字符“A”对应0000000001000001.   Foudation框架大约支持20种 阅读详情

相关推荐

UE5.3.2 + VS2022社区版在Win11上的C++编译环境配置全解

Unreal Engine 5的C++开发依赖严格的工具链协同,其核心在于Visual Studio编译器版本、Windows SDK与引擎构建系统(UBT)的精准匹配。UE5.3.2强制要求MSVC v143.4(即VS2022 17.4+)及Windows 11 SDK 10.0.22621.0,任何偏差都会引发LNK2019链接失败、C1083头文件缺失或MSB8066构建中断等典型错误。该配置不仅关乎安装顺序,更涉及注册表清理、PATH环境变量、SDK路径注入与运行时DLL加载等底层机制。适用于Wi

weixin_33978722的博客 367

IOS NSString字符串基本操作

//创建一个字符串常量 NSString *string100=@"这是一个常量,"; //创建一个空字符串 NSString *string101=[[NSString alloc] init]; NSString *string102=[NSString string]; //快速创建字符串 NSString *string103=[[NSString alloc] initWithStrin

sunyu2033的专栏 376

(R,线性回归)R语言里的模型诊断图(Residuals vs Fitted,Normal QQ , Scale-Location ,Residuals Leverage)

线性回归,是概率统计学里最重要的统计方法,也是机器学习中一类非常重要的算法。线性模型简单理解非常容易,但是内涵是非常深奥的。尤其是线性回归模型中的Diagnostics plot的阅读与理解一直被认为是线性回归中的一个难点。 在任何线性模型中,能够直接“lm”(模型有意义),既要考虑各个参数的t-test所得出的p-value,也要考虑总体模型F-检验得出的p-value。在这之后,还要清楚一个...

qq_35837578的博客 7万+

关于ios中 NSString在方法中进行修改,需要传该NSString的指针的指针的问题

本人新学,请大家照顾下。。 假如有如下方法: void changeStr(NSString **str2){     *str2 = @"123"; } void my(NSString *ss){     NSLog(@"传入前的地址是%p -> %p -> %@",&ss,ss,ss);         //NSLog(@"%@",*ss);     //*(&(*ss)) = 

weipucai9377的博客 845

AI人工智能领域多模态大模型的数字孪生应用

本文旨在系统性地介绍多模态大模型在数字孪生领域的最新应用进展,探讨其技术原理、实现方法和应用价值。内容范围涵盖从基础概念到前沿技术,从理论分析到实践案例。文章首先介绍多模态大模型和数字孪生的基本概念,然后深入分析两者的结合点,接着通过具体案例展示应用实践,最后探讨未来发展趋势和挑战。多模态大模型:能够同时处理和融合多种数据模态(如文本、图像、视频、音频等)的大型人工智能模型数字孪生:物理实体或系统的虚拟副本,通过实时数据同步实现虚实交互跨模态融合:将不同数据模态的信息进行有效整合和关联的技术。

AI云原生与云计算技术学院 1325

深入了解BPM及BPM业务流程管理系统

BPM 即业务流程管理,是一种以规范化的构造端到端的卓越业务流程为中心,以持续地提高组织业务绩效为目的的系统化方法。它涵盖了业务流程的整个生命周期,包括流程的设计、执行、监控、分析和优化。BPM 作为一种先进的管理方法,对于企业提高运营效率、降低成本、提升客户满意度和增强竞争力具有重要意义。BPM 流程管理系统为企业实现 BPM 提供了强大的工具和支持,而 F2BPM 流程管理平台以其先进的技术架构、丰富的功能模块、简单易用的操作界面和强大的定制能力,成为企业实现业务流程管理的理想选择。

Stone3625的博客 2952

iOS开发分分钟搞定C语言—— 字符串和指针

指针对于C语言来说重要的意义不言而喻,C语言没掌握指针就相当于没学。但作为iOS开发来说,并没有想象的那么难,因为在iOS开发中,objective c 语言以及把指针优化成类似数据类型来使用,把指针具体化了,使得整个指针没有那么复杂了,并且在iOS开发中,多级指针的使用是非常非常少的,所以对于iOS开发人员来说,学习C语言的指针别纠结,别纠结,别纠结,掌握指针在C语言中概念,一级指针的基本概念,指

求知若渴,虚心若愚,努力前行,未来可期。 1658

【AIGC】大模型面试高频考点07-注意力(Attention)篇

AIGC面试高频考点

一个内容严谨、方向前沿、极具实践价值的AI大模型技术分享站 3363

Foundation框架之 NSString 和 集合

本文主要介绍以下几部分 框架是由许多类、方法、函数、文档按照一定的逻辑组织起来的集合。 Foundation框架则定义Objective-C中底层的类,是Mac / iOS 其他框架的基础。它不仅提供了一系列有用的基本对象类,还引入了一些在OC语言中没有的功能范式。Foundation框架的设计目的是: (1

yanggangclcsdn的博客 1092

SAP会计凭证导入ABAP开发模板+注意点—附带源码

开发并不仅仅只要考虑实现的功能,只实现功能的是程序,考虑到使用场景的是工程。使用bapi校验创建会计凭证的数据,报错和参数和正式创建一致。用途,防止产生错误的凭证,即使财务凭证可以冲销。正式创建会计凭证。隐藏的坑。

小九啥也不会 1232

材料仿真软件:Materials Studio_(14).电学性质计算

设置计算参数,包括 k 点网格、交换相关泛函等。

kkchenjj的博客 1864

Objective-C:Foundation框架-常用类-NSString全解

  Foundation框架中常用的类有字符串、集合、字典等,这里介绍字符串NSString。本文分别介绍了NSString的创建、从文件里读取NSString字符串、通过函数改变外部的NSString变量的值、NSString字符串的导出、NSString的常用方法等5个部分。 1.NSString的创建: #pragma mark NSString的创建 void stri...

asqwzx123123123123的博客 164

【RT-DETR涨点改进】小目标检测、特征融合改进篇 | TGRS 2024 | RT-DETR引入CSFM上下文选择融合模块,适合多模态检测、红外小目标检测、小目标检测、遥感目标检测等任务有效涨点

本文提出了一种改进RT-DETR目标检测模型的方法,通过引入上下文选择融合模块(CSFM)显著提升复杂背景下小目标和低对比度目标的检测精度。CSFM模块采用多尺度特征融合和动态特征选择机制,有效增强模型的全局上下文感知能力,同时保留细节特征。该模块通过通道减少机制和空间信息调节,实现从粗到细的特征聚合,减少误报并提高轮廓检测精度。实验表明,改进后的RT-DETR模型在多个基准测试中表现优异,计算效率与检测精度均优于现有方法。文章还详细介绍了模块配置和yaml文件修改方法,为模型部署提供指导。

Ai缝合怪、助力小伙伴高效发论文 1725

Foundation框架详解

重写isEqual:和hash方法(isEqual:方法判断相等,hash返回值相等)实现copyWithZone:方法,最好返回该对象的不可变副本为了避免索引(key)被破坏,NSDictionary总会先调用该key的copy方法复制该对象的不可变副本,然后用该副本作为NSDictionary的key。

2401_87841908的博客 1009

精雕软件(JDpaint) 5.5 绿色版

精雕软件(JDpaint) 5.5 绿色版精雕软件(JDpaint) 5.5 绿色版精雕软件(JDpaint) 5.5 绿色版

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

IOS 基础知识-Foundation框架

Foundation框架代理设计模式Protocol基本概念Protocol类型限制Protocol其他用法Foundation框架介绍字符串读写字符串比较字符串搜索字符串截取字符串替换字符串与路径字符串与基本数据类型转换NSMutableString练习NSMutableString常用方法NSArray 遍历NSArray排序NSArray文件读写NSArray 与字符串 代理设计模式 ##本...

kyl282889543的博客 1436

大中型超市收银系统(可直接运行)

光步前台收银系统系统功能:商品销售、商品退货、挂单、收银员权限、会员销售、单品取消、整单取消、商品查询、脱机销售、脱机数据上传,基本资料下载,开钱箱、小票打印、收款结算,支持多币种付款方式(现金、储值卡、礼券、微信等),支持多种促销。运行环境:.net 4.0登陆信息用户名:1001 密码:123456内置商品信息,商品编码可输入00001000 - 00010000,测试效果相关功能键F5 结算 F9挂单 F11商品查询 F8退货 Insert单品取消 Del整单取消 F12开钱箱F2 会员 Ctrl+Z退出系统 Home 锁屏 相关源码待公开

Foundation框架-01 NSString对象

Foundation框架-01 NSString对象 Objective-C

MrRightZJ的博客 500

SIMATIC S7-1200, S7-1500 PID 控制[手册]

SIMATIC S7-1200, S7-1500 PID 控制[手册]

Foundation框架——字符串(NSString和NSMutableString)

字符串NSString与NSMutableString 创建字符串事例 字符串就是一连串的字符序列,Objective-C中有两个字符串:NSString和NSMutableString,其中,NSString代表自负序列不可变的字符串,而NSMutableString则代表字符序列可变的字符串。 创建字符串 NSString代表字符序列不可变的字符串,NSString的功能非常强大,Objective-C的字符串处理比C语言字符串简单、易用的多。 NSString具有的功能如下: 1.创建字符串:创建字符

weixin_51638861的博客 359

【Objective—C】——Foundation框架详解(上)

本周学习了OC中的foundation框架,下面我将总结一下本周的学习成果。OC中集合可分为:NSArray、NSSet和NSDictionary三种体系,其中NSArray代表有序、可重复的集合;NSSet代表无序、不可重复的集合;NSDictionary代表具有映射关系的集合。集合类和数组不一样,数组元素可以是基本类型的值也可以是对象,而集合只能保存对象(实际上是保存对象的指针变量)。

m0_73974920的博客 629

初识Objective-C

一、什么是Objective-C Objective-C是C语言的一个扩展集,几乎所有的OS X或IOS平台上的应用程序都是用该语言开发的。由于是对C的扩展,因此本篇以及之后的所有Objective-C相关的文章都将重点介绍Objective-C在C上添加的新特性,那么C的基础此处将不再赘述。 二、简单的Objective-C程序 #import <Foundation/Foundation.h> int main(int argc, const char* argv[]) { NSLog(@

CR7lmz的博客 468

Foundation 之字符串 NSString和NSMutableString 用法

1.NSString 字符串常用方法 1.0      OC、C字符串类型转换 char *s = @“hello”; NSString *str = @“hello”; C->OC:     NSString *str1 = [NSString stringWithUTF8String:s]; OC->C:     [str UTF8Strig]; 1.1     创建字符串、格式化

someone的博客 395

Objective-C 2.0运行时与Cocoa Foundation底层原理深度解析

Objective-C 2.0并非过时语法,而是macOS/iOS系统级契约的运行时基石。其核心在于动态消息转发(objc_msgSend)、内存管理协议(autorelease pool、weak引用)、属性合成机制(@dynamic/@synthesize)及KVC/KVO元编程能力——这些共同构成Foundation框架的底层支撑。理解isa指针、方法缓存(cache_t)、关联对象(objc_setAssociatedObject)和类型编码(@encode)等机制,是调试Swift桥接异常、Cor

didi9310的博客 458

Objective-C Foundation框架实践——NSString(四)

#import int main(int argc, const char * argv[]) { @autoreleasepool { ////////////////////////// //读取文件; //1.本地文件; 2.网络文件; //路径类 NSString *string11 = @"http://www.bai

乞力马扎罗的雪CYF的博客 1601

【Objective-C】Foundatio框架详解

OC学习,NS这个前缀来源于乔布斯Jobs当年被Apple公司股东开除后,创立的NextStep公司的缩写,ta也是cocoa框架的发源地

XY_Mckevince的博客 396

OC开发之——Foundation中的NSString(53)

一 概述 本文介绍NSString中相关的操作如: NSString的创建 OC中NSString和C中字符串的转换 读取文本中的字符串和写入字符串 二 NSString的创建 //NSString的创建 NSString *s1=@"jack"; NSString *s2=[[NSString alloc]initWithString:@"jack"]; NSString *s3=[[NS...

我的博客 229

Foundation框架学习之NSString和NSMutableString

由于Swift语言一直有在更新,且IOS开发中有很多库都是使用Objective-C语言的,所以Objective-C的学习还是很有必要的,下面是对NSString学习的一些记录。 // // main.m // OCDemo1 // // Created by dcr on 2016/12/7. // Copyright © 2016年. All rights reserved. //

DMT专栏 464
上一篇: Objective-C之Foundation中常见的结构体struct
下一篇: Objective-C之Foundation中的NSString的一些常用的方法
技术宝哥
博客等级 码龄16年 331粉丝 222原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值