码迷,mamicode.com
首页 >  
搜索关键字:nsstring    ( 4622个结果
[OC Foundation框架 - 23] 文件管理
A. 目录管理 1 NSFileManager*manager = [NSFileManagerdefaultManager];//单例模式 2 3 // 1.获取文件属性 4 NSString *path = @"/Users/hellovoidw...
分类:其他好文   时间:2014-11-24 20:46:20    阅读次数:181
[OC Foundation框架 - 3] 指向指针的指针
使用函数改变NSString 1 void changeStr2(NSString **str3) 2 { 3 *str3 = @"789"; 4 } 5 6 int main(int argc, const char * argv[]) { 7 @autoreleasepool ...
分类:其他好文   时间:2014-11-24 20:46:16    阅读次数:191
[OC Foundation框架 - 5] NSString的常用方法
1 NSString *s1 = @"0123456789";1.比较使用 == 号比较的是字符串地址1 NSString *s4 = @"abcdefg";2 NSString *s4_sub = [s4 substringToIndex:3];...
分类:其他好文   时间:2014-11-24 20:41:01    阅读次数:189
[Objective-c 基础 - 2.10] description方法
A. 实例对象打印-description1.当使用NSLog函数并且使用%@占位符的时候,会调用对象的-description方法2.拿到-description的返回值,显示到console中默认返回指针地址 1 @implementation Person 2 3 - (NSString *....
分类:其他好文   时间:2014-11-24 20:35:03    阅读次数:224
[OC Foundation框架 - 2] NSString 的创建
A. 不可变字符串 1 void stringCreate() 2 { 3 //Don't need to release memory by this way 4 NSString *str1 = @"String Sample"; 5 6 NSString *st...
分类:其他好文   时间:2014-11-24 20:34:14    阅读次数:175
[OC Foundation框架 - 4] NSString的导出
1 void exportString() 2 { 3 NSString *str = @"Hello, 坑爹"; 4 NSString *path = @"/Users/hellovoidworld/Study/Foundation/NSString/abc.txt"; 5 ...
分类:其他好文   时间:2014-11-24 20:33:42    阅读次数:238
[OC Foundation框架 - 17] copy语法
一个对象使用copy或mutableCopy方法可以创建对象的副本1.copy需要实现NSCopying协议创建的是不可变副本,如NSString, NSArray, NSDictionary(1)不可变对象调用copy不会产生新的对象,而是返回对象本身,相当于retain,计数器+1属于浅拷贝(2...
分类:其他好文   时间:2014-11-24 20:33:32    阅读次数:168
[Objective-c 基础 - 2.5] NSString
1.NSString基本使用使用%@占位符输出对象1 int age = 15;2 int no = 5;3 NSString *str2 = [NSString stringWithFormat:@"My age is %d and no is %d", age, no];...
分类:其他好文   时间:2014-11-24 20:32:35    阅读次数:142
iOS 版本更新检查
//检查更新-(void)onCheckVersion{//获取当前版本 NSDictionary *infoDic = [[NSBundle mainBundle] infoDictionary]; NSString *currentVersion = [infoDic objectForKe.....
分类:移动开发   时间:2014-11-24 19:08:39    阅读次数:165
NSArray 基础
NSString* str=@"today"; Person* p1 = [[Person alloc]init]; //nil空对象,NULL表示空类 //方法1:数组的初始化方法 NSArray *array = [[NSArray alloc]initWithObjects:@"123",.....
分类:其他好文   时间:2014-11-24 19:04:24    阅读次数:195
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!