`
zcw_java
  • 浏览: 296830 次
  • 性别: Icon_minigender_1
  • 来自: 上海
社区版块
存档分类
最新评论
文章列表
#import <Foundation/Foundation.h> @interface WeiboUserInfo : NSObject<NSCoding> { NSString *m_strDeviceJid; //绑定的设备的jid NSString *m_strSinaJid; //sina帐号的jid NSString *m_strSinaPasswd; //sina帐号密码 NSString *m_strNickName; //sina帐号的昵称 NSString ...

Tableview详解

一,为tableview中cell,修改其样式 [tableView deselectRowAtIndexPath:indexPath animated:YES]; UITableViewCell *celling = [tableView cellForRowAtIndexPath:indexPath]; for (int i = 0; i < [m_mutArrInitModelDataList count]; i++) { NSIndexPath *indexPath1 = [NSIndexPath indexPathForRow: ...
一、引入MKNetworkKit 1,添加MKNetworkKit的到工程目录。 2,添加的CFNetwork.Framework,SystemConfiguration.framework,Security.framework和ImageIO.Framework。 3,PCH文件包含MKNetworkKit.h 4,如果您正在构建针对iOS,删除NSAlert + MKNetworkKitAdditions.h文件。 5,如果您正在构建的Mac,删除UIAlertView + MKNetworkKitAdditions.h文件。 二、MKNetworkKit类 1,MKNetworkOp ...

ios国际化

前些天升级到Xcode4.5,现在正在用Xcode4.5+IOS6开发项目,当使用国际化时,遇到了一点问题,之前版本Xcode上新建Localizable.strings后,添加语言的“+”号不见了,找了半天无果,自己研究了下,后来在Stackoverflow上找到了解决方案,原来Apple把这个“+”号换地方了。下面来看看如何使用。 首先新建一个名为Localizable.strings的资源文件 完成后选中该文件,在属性选择器中可以看到多了个按钮: 点击这个按钮后,出现国际化语言选择框,但只有一个English的选项: 没关系,继续,点击Localize按钮,这时只支持英语。X ...
分享源码,有问题回复 SDWebImage 异步加载 缓存图片 Http请求次数限制等,期待大家共同研究学习 //清楚缓存、磁盘存储 -(void)removeImageForKey:(NSString *)key; key就是你那个[url obsoluteString];

ios文件读写

//写入缓存文件,缓存目录下 NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory,NSUserDomainMask, YES); NSString *strDocumentsDirectory = paths[0]; NSString *strCacheDirectoryName = [strDocumentsDirectory stringByAppendingPathComponent:[NSString stringWithFormat:@"%@_Ala ...
对于MacOS设备不同,做出相应响应 #if TARGET_OS_IPHONE //iPhone真机 #elif TARGET_OS_MAC //Mac下 #elif TARGET_IPHONE_SIMULATOR //iPhone模拟器 #endif //结束 pch是对整个项目的预编译 #ifdef __OBJC__ #import <UIKit/UIKit.h> #import <Foundation/Foundation.h> #import "AppDelegate.h" #endi ...
可在viewDidAppear中实现加入 [tablvew setContentOffset:CGPointMake(0,480) animated:YES];  在tableView内添加一个searchbar,一起滚动;开始时隐藏headerView(即让tableView向上滚动headerView的高度:默认44)  UISearchBar *mySearchBar = [[UISearchBar alloc] init];  [mySearchBar sizeToFit];    tableView.tableHeaderView = mySearchBar;  //UIT ...

UILable手册

1,自动算出长度,宽度 CGSize notRecommentedSize = [labNotRecommented.text sizeWithFont:labNotRecommented.font constrainedToSize:size lineBreakMode:NSLineBreakByWordWrapping];
    NSMutableArray *array = [NSMutableArray array];     for (int i = 0; i < 10; i ++) {         [NSThread sleepForTimeInterval:1.f];         Test23 *test = [[Test23 alloc] init];         test.name = [NSString stringWithFormat:@"name_%d",i];         test.date = [NSDate date];         [arr ...
用于uidate,picker。。 +(NSDate*) convertDateFromString:(NSString*)uiDate { NSDateFormatter *formatter = [[NSDateFormatter alloc] init] ; [formatter setDateFormat:@"yyyy年MM月dd日"]; NSDate *date=[formatter dateFromString:uiDate]; return date; } 输入的日期字符串形如:@" ...
定义宏和结构体 #define ENTRYCOUNT 100 #define DATASIZE 256 typedef struct alarm_data_struct { int pos; char data[ENTRYCOUNT][DATASIZE]; }stuct_alarm; 将NSString转换char - (const char *)NSStringToChar:(NSString *)string //将NSString转化为char { NSStringEncoding enc = CFStringConvert ...
对于NSDate常用操作整理,如有不足请补充 1,获取当前时区时间 //初始化时间段 NSDate *date = [NSDate date]; //获取当前时区 NSTimeZone *zone = [NSTimeZone systemTimeZone]; //以秒为单位返回当前应用程序与世界标准时间(格林威尼时间)的时差 NSInteger interval = [zone secondsFromGMTForDate: date]; //补充时差后为当前时间 NSDate *localeDate = [date dateByAddingTimeInterval: int ...
NSNotificationCenter 第一种,这个只是传值,通过NSNotification获取,当然也可以直接使用obj 注册A [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(enableOrDisableAudio:) name:@"enableOrDisableAudio" object:nil]; - (void)enableOrDisableAudio:(NSNotification *)notification { printf(&quo ...
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; NSString *fileURL = [NSString stringWithFormat:@"http://%@/image/%@/show.jpg?n=%d", 1,1]; NSData *dateImg = [NSData dataWithContentsOfURL:[NSURL URLWithString:fileURL]]; ...
Global site tag (gtag.js) - Google Analytics