- 博客(130)
- 资源 (9)
- 收藏
- 关注
原创 ios序列化对象存储本地
[code="c"]#import @interface WeiboUserInfo : NSObject{ NSString *m_strDeviceJid; //绑定的设备的jid NSString *m_strSinaJid; //sina帐号的jid NSString *m_strSinaPasswd; //sina帐...
2013-09-10 14:14:56
246
原创 Tableview详解
一,为tableview中cell,修改其样式[code="c++"][tableView deselectRowAtIndexPath:indexPath animated:YES]; UITableViewCell *celling = [tableView cellForRowAtIndexPath:indexPath]; for (int i = 0; i < ...
2013-08-22 15:47:18
277
原创 使用MKNetworkKit函数Demo
[color=red]一、引入MKNetworkKit[/color][color=blue]1,[/color]添加MKNetworkKit的到工程目录。[color=blue]2,[/color]添加的CFNetwork.Framework,SystemConfiguration.framework,Security.framework和ImageIO.Framework。[c...
2013-08-16 13:41:40
285
原创 ios国际化
前些天升级到Xcode4.5,现在正在用Xcode4.5+IOS6开发项目,当使用国际化时,遇到了一点问题,之前版本Xcode上新建Localizable.strings后,添加语言的“+”号不见了,找了半天无果,自己研究了下,后来在Stackoverflow上找到了解决方案,原来Apple把这个“+”号换地方了。下面来看看如何使用。首先新建一个名为Localizable.strings的...
2013-08-15 15:22:38
176
原创 SDWebImage Demo手册
分享源码,有问题回复SDWebImage 异步加载 缓存图片 Http请求次数限制等,期待大家共同研究学习//清楚缓存、磁盘存储-(void)removeImageForKey:(NSString *)key;key就是你那个[url obsoluteString];...
2013-08-13 12:58:04
118
原创 ios文件读写
[code="c++"]//写入缓存文件,缓存目录下 NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory,NSUserDomainMask, YES); NSString *strDocumentsDirectory = paths[0]; NSString *strCa...
2013-08-12 15:44:26
117
原创 ios使用预编译命令解决问题
对于MacOS设备不同,做出相应响应[code="c++"]#if TARGET_OS_IPHONE//iPhone真机#elif TARGET_OS_MAC//Mac下#elif TARGET_IPHONE_SIMULATOR//iPhone模拟器#endif//结束[/code]pch是对整个项目的预编译[code="c++"]#ifde...
2013-08-12 13:44:10
102
原创 tableview设置上下滚动高度,启用删除
可在viewDidAppear中实现加入 [tablvew setContentOffset:CGPointMake(0,480) animated:YES]; 在tableView内添加一个searchbar,一起滚动;开始时隐藏headerView(即让tableView向上滚动headerView的高度:默认44) UISearchBar *mySearchBar = [[UIS...
2013-08-06 17:14:03
202
原创 UILable手册
1,自动算出长度,宽度CGSize notRecommentedSize = [labNotRecommented.text sizeWithFont:labNotRecommented.font constrainedToSize:size lineBreakMode:NSLineBreakByWordWrapping];
2013-08-02 13:25:38
92
原创 NSMutableArray排序
NSMutableArray *array = [NSMutableArray array]; for (int i = 0; i < 10; i ++) { [NSThread sleepForTimeInterval:1.f]; Test23 *test = [[Test23 alloc] init]; test.name...
2013-07-26 15:44:41
149
原创 NSDate和NSString的转换
[code="c++"]用于uidate,picker。。+(NSDate*) convertDateFromString:(NSString*)uiDate{ NSDateFormatter *formatter = [[NSDateFormatter alloc] init] ; [formatter setDateFormat:@"yyyy年MM月dd日"...
2013-07-15 14:43:05
115
原创 c++结构体在ios端解析
定义宏和结构体[code="c++"]#define ENTRYCOUNT 100#define DATASIZE 256typedef struct alarm_data_struct{ int pos; char data[ENTRYCOUNT][DATASIZE];}stuct_alarm;[/code]将NSString转换cha...
2013-07-11 09:20:35
178
原创 NSDate-常用操作及控制
[align=center]对于NSDate常用操作整理,如有不足请补充[/align]1,获取当前时区时间[code="c++"]//初始化时间段NSDate *date = [NSDate date];//获取当前时区NSTimeZone *zone = [NSTimeZone systemTimeZone];//以秒为单位返回当前应用程序与世界标准时间(格林威...
2013-07-05 10:42:59
118
原创 NotifiCationCenter控制使用
[align=center]NSNotificationCenter[/align]第一种,这个只是传值,通过NSNotification获取,当然也可以直接使用obj注册A[code="c++"][[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(enableOrDisable...
2013-07-02 11:31:48
218
原创 NSURL转NSData转UIImage
[code="c++"]NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; NSString *fileURL = [NSString stringWithFormat:@"http://%@/image/%@/show.jpg?n=%d", 1,1]; ...
2013-07-01 15:37:22
1232
原创 UIImage压缩和缩放
节省大量内存,重绘缩略图;#define K_contentsOfFile(fileName,fileType) [UIImage imageWithContentsOfFile:[[NSBundle mainBundle] pathForResource:fileName ofType:fileType]]3种方法,分别是调整、居中、填充方式。[color=red]1、等...
2013-07-01 14:31:25
248
原创 转载ios开发资源汇总
如何用Facebook graphic api上传视频: http://developers.facebook.com/blog/post/532/ Keychain保存数据封装: https://github.com/carlbrown/PDKeychainBindingsController 对焦功能的实现: http://www.clingmarks.com/?p=612...
2013-06-28 15:02:26
137
原创 ios将模拟器与真机.a文件合并
1,command+b build一下工程2,Debug-iphoneos和Debug-iphonesimulator文件下都会出现一个.a文件3,将Debug-iphonesimulator中重命名xxx_i386.a4,将两个文件都拷贝到一个目录下,打开终端5,xxxiMac:111 Ken$ [color=red]lipo -info libupnpx_i386.a [...
2013-06-24 16:54:10
282
原创 UITableViewCell自定义
添加到选中cell中,每一个cell闪烁1秒[tableView deselectRowAtIndexPath:indexPath animated:YES];设置cell背景色和背景图[code="c++"]UIView *backgrdView = [[UIView alloc] initWithFrame:cell.frame];backgrdView.backgro...
2013-06-18 16:22:50
142
原创 PickerView准备捕获时间,循环滚动demo
最重要的下面几行代码[code="c++"]- (void) clickRightBarItem{ NSInteger row0 = [m_pickerSetupAlarmDate selectedRowInComponent:0]; NSInteger row1 = [m_pickerSetupAlarmDate selectedRowInComponent:1]...
2013-06-18 15:09:00
148
原创 UI圆角以及阴影等效果利用layer属性
制作圆角button等[code="c++"]//必须导入的空间#import就拿view来举例view.layer.masksToBounds=YES; //设置为yes,就可以使用圆角view.layer.cornerRadius= 5; //设置它的圆角大小view.layer.borderWidth=1; //视图的边框宽度view.layer.bord...
2013-06-17 10:42:52
190
原创 NSOrderedSame NSOrderedAscending NSOrderedDescending枚举比较a==b
[code="c++"] NSString 两个字符串的比较,用 a compare:b 来比,得出的结果分3种 1. 26个字母比较 越靠后面 越大 NSString *a = @"qweqwe"; NSString *b = @"qweasd"; BOOL result = [a compare:b]; if (result == NS...
2013-06-14 15:55:42
122
原创 push隐藏Tabbar,navBar
[self.navigationController setNavigationBarHidden:YES];self.navigationController.hidesBottomBarWhenPushed = YES; //这句是隐藏tabbar返回时先[self.navigationController setNavigationBarHidden:NO]; 或在前...
2013-06-14 12:00:51
108
原创 使用模态视图
下面两个是模态视图两个动画的参数,设置的时候可以写成[code="c"]self.modalPresentationStyle = 1;[self presentModalViewController:navSetWireless animated:YES];//modalTransitionStyle跟modalPresentationStyle相互对应[/code]...
2013-06-05 16:28:28
185
原创 iphone常用线程编写
1,创建一个新的子线程[code="c"]//在分线程中操作[NSThread detachNewThreadSelector:@selector(saveUserData) toTarget:self withObject:nil];[/code]2,如果不在主线程中,将其加入主线程[code="c"]//如果当前非主线程,将其加入主线程if (![NSThr...
2013-06-03 15:29:00
68
原创 Reachability使用说明<转载>
一:确认网络环境3G/WIFI 1. 添加源文件和framework 开发Web等网络应用程序的时候,需要确认网络环境,连接情况等信息。如果没有处理它们,是不会通过Apple的审(我们的)查的。 Apple 的 例程 Reachability 中介绍了取得/检测网络状态的方法。要在应用程序程序中使用Reachability,首先要完成如下两部: ...
2013-05-28 09:56:01
172
原创 iPhone获取wifi列表
首先,app如果要上app store是没有办法获取wifi列表的~这些WIFI扫描软件使用了苹果的私有函数apple80211.framework尽管不能合法(指能通过App Store的审核)的获取WIFI列表, 不过我们还是可以获取到当前Wifi连接的信息,比如SSID.SSID全称Service Set IDentifier, 即Wifi网络的公开名称.苹果...
2013-05-21 17:13:56
381
原创 IOS之JsonKit解析,版本号获取
版本号的获取如下:[code="c"]NSString *executableFile = [[[NSBundle mainBundle] infoDictionary] objectForKey:(NSString *)kCFBundleExecutableKey]; NSString *version = [[[NSBundle mainBundle] infoDicti...
2013-05-20 14:28:08
100
原创 NSString常用操作
[code="c"]//将NSData转化为NSString NSString* str = [[NSString alloc] initWithData:response encoding:NSUTF8StringEncoding];//将NSString 转化为NSData (NSString.h)- (NSData *)dataUsingEncoding:(...
2013-04-27 19:06:28
160
原创 NSTimer
启动 Timer[color=blue]– fire[/color]停止 Timer[color=blue]– invalidate[/color]Timer设置[color=blue]– isValid– fireDate– setFireDate:– timeInterval– userInfo[/color][code="c"]self.m...
2013-04-24 16:32:39
126
原创 view添加手势与延迟加载
[code="c"]UITapGestureRecognizer *singleTap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(handelSingleTap:)]; [self.m_tableView addGestureRecognizer:singleTap]; [s...
2013-04-17 16:12:00
88
原创 addSubview对于引用计数操作
[code="c"]- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{ static NSString *cellIdetifier = @"blogCellIdentifier"; UITableViewCell ...
2013-04-11 10:19:37
412
原创 初始化initWithNibName与viewDidLoad
initWithNibName初始化nib文件,加载结束调用viewDidLoadviewDidLoad在初始化nib文件后的初始化工作,可以用于初始化ui。。。后期补全
2013-04-08 12:31:00
103
原创 何时用self引用会加1,[UIImage imageNamed]使用
代码粘的多了点,看着清楚一点SetupAccountViewController.h文件,声明m_comBoxView,线程不安全,retain(self调用引用+1)[code="c"]#import #import "ComBoxView.h"@interface SetupAccountViewController : UIViewController{ ...
2013-04-07 14:08:40
116
原创 菜鸟动画问题解决
COCOS2D对OpenGL进行得封装今天一个菜鸟说:后面触发一个事件之后 又要播放一次如果不删除之前的 会出现重叠的效果代码如下:播放代码[code="c"]-(void) TrafficShipAnimation{ [[CCSpriteFrameCache sharedSpriteFrameCache] addSpriteFramesWithFile:...
2012-11-23 11:50:02
133
原创 OC之单例模式
[code="c"] static MyGizmoClass *sharedGizmoManager = nil; + (MyGizmoClass*)sharedManager { @synchronized(self) { if (sharedGizmoManager == nil) { ...
2012-11-22 20:09:46
95
原创 NSDate和NSString的转换
用于uidate,picker。。//将string转换成data类型 NSData *dataXML = [m_strCurParser dataUsingEncoding:NSASCIIStringEncoding]; NSXMLParser *xmlParser = [[NSXMLParser alloc] initWithData:dataXML];+(...
2012-11-22 14:51:44
78
原创 UITableView取消选中颜色、常用操作
使用空白view取代cell- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{ //取消选中颜色 UIView *backView = [[UIView alloc] initWithFrame:cell.fra...
2012-11-22 14:49:30
105
原创 IOS 开发,调用打电话,发短信,打开网址
1、调用 自带mail[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"mailto://admin@hzlzh.com"]]; 2、调用 电话phone[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"...
2012-11-22 14:48:16
124
原创 笔记备份
ios电子http://www.itpub.net/forum.php?mod=forumdisplay&fid=61&page=1http://www.doc88.com/p-298947886199.htmlhttp://www.docin.com/p-306361271.htmllinux日志tail -200f /u02/logs/dolphin_cms_l...
2012-11-20 21:46:42
70
charles抓包工具
2016-10-20
ios 消息NSNotificationCenter多页面传参
2013-04-26
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人