
功能代码
文章平均质量分 69
First1199
此人很懒什么也没留下
展开
-
UITableView样式的自定义
很多时候,我们需要自定义UITableView来满足我们的特殊要求。这时候,关于UITableView和cell的自定义和技巧太多了,就需要不断的总结和归纳。1.添加自定义的Cell。这个问题已经涉及过,但是,这里要说的主要是两种方法的比较!因为,我经常发现有两种方式:1.xib方式这种方式,也就是说,为自定义的UITableView转载 2013-07-29 19:48:33 · 874 阅读 · 0 评论 -
总结代码
1、页面跳转复制代码 //隐藏底部的菜单栏 self.hidesBottomBarWhenPushed = YES; // 初始化页面并且跳转 Newpage*newpage=[[Newpage alloc]init]; [self.navigationController pushViewController:about animated:YES];原创 2013-08-30 11:57:02 · 811 阅读 · 0 评论 -
IOS正则
NSString *regStr4 = @"(@\\w+)|(#\\w.+#)|(http(s)?://([A-Za-z0-9._-]+(/)?)*)"; //使用系统自带的类库 NSRegularExpression *reg = [NSRegularExpression regularExpressionWithPattern:regStr4 options:NSRe原创 2013-08-30 11:14:42 · 700 阅读 · 0 评论 -
宏定义
#define kScreenHeight [UIScreen mainScreen].bounds.size.height#define kScreenWidth [UIScreen mainScreen].bounds.size.width原创 2013-08-30 11:17:32 · 651 阅读 · 0 评论 -
IOS所有对象实体的基类
@interface WXBaseModel : NSObject {}-(id)initWithDataDic:(NSDictionary*)data;- (NSDictionary*)attributeMapDictionary;- (void)setAttributes:(NSDictionary*)dataDic;- (NSString *)customDescription原创 2013-08-30 11:24:10 · 1621 阅读 · 0 评论 -
WXModel微博使用2个方法
-(NSDictionary*)attributeMapDictionary{ NSDictionary *dic = @{ @"created_at" : @"created_at", @"weiboID" : @"id",原创 2013-08-30 11:27:47 · 1181 阅读 · 0 评论 -
NSURLConnection和NSMutableURLRequest 实现同步、异步请求
一、同步请求-GET方式// 要请求的地址 NSString *urlString=@"地址,我就只有保密了!你懂的";// 将地址编码 urlString = [urlString stringByAddingPercentEscapesUsingEncoding: NSUTF8StringEncoding]; // 实例化NSMutableURLRequest,并转载 2013-08-30 11:43:18 · 1140 阅读 · 0 评论 -
IOS 一个.m文件里面响应了哪些方法的查看
#ifdef _FOR_DEBUG_ -(BOOL) respondsToSelector:(SEL)aSelector { printf("SELECTOR: %s\n", [NSStringFromSelector(aSelector) UTF8String]); return [super respondsToSelector:aSelector]; } #en原创 2013-09-07 17:23:24 · 946 阅读 · 0 评论 -
ios 开发之使用Reachability检测网络状态
一:确认网络环境3G/WIFI 1. 添加源文件和framework 开发Web等网络应用程序的时候,需要确认网络环境,连接情况等信息。如果没有处理它们,是不会通过Apple的审(我们的)查的。 Apple 的 例程 Reachability 中介绍了取得/检测网络状态的方法。要在应用程序程序中使用Reachability,首先要完成如下两部:转载 2013-09-02 09:11:51 · 2269 阅读 · 0 评论 -
【IOS】动画总结:UIView动画(Animations)
摘要: UIKit直接将动画集成到UIView类中,实现简单动画的创建过程。UIView类定义了几个内在支持动画的属性声明,当这些属性发生改变时,视图为其变化过程提供内建的动画支持。执行动画所需要的工作由UIView类自动完成,但仍要在希望执行动画时通知视图,为此需要将改变属性的代码包装到一个代码块中。 1.UIView动画具体创建方法 - (void)butto转载 2013-09-10 10:20:05 · 1118 阅读 · 0 评论 -
IOS 自定义presentModalViewController动画
UIWebView *webView = [[UIWebView alloc]init];UINavigationController *navigation = [UINavigationController alloc]initWithRootViewController:webView];//navigation.modalTransitionStyle = UIModalT原创 2013-09-10 10:12:05 · 1974 阅读 · 0 评论 -
IOS 计时器 NSTimer
IOS 计时器 NSTimer 1、初始化+ (NSTimer *)timerWithTimeInterval:(NSTimeInterval)ti target:(id)aTarget selector:(SEL)aSelector userInfo:(id)userInfo repeats:(BOOL)yesOrNo;+ (NSTimer *)scheduledTi转载 2013-09-10 10:19:24 · 857 阅读 · 0 评论 -
Iphone图片拉伸的几种方法
UIImageResizingModeTile和 UIImageResizingModeStretch两种模式,从名字就可以看出,是平铺模式和拉伸模式。平铺就是复制你Insets指定的矩形区域块来填充你所指定的图片区域,而拉伸就是通过拉伸你Insets指定的矩形区域块来填充你 所需的图片区域。AD:2013云计算架构师峰会超低价抢票中系统至ios6之后,关于转载 2013-09-04 09:15:19 · 1051 阅读 · 0 评论 -
让你永远都见不到系统自带的Toobar
for (UIView *view in self.view.subviews) { if ([view isKindOfClass:[UITabBar class]]) { view.frame=CGRectMake(0, kScreenHeight, 0, 0); }e原创 2013-09-17 17:42:09 · 729 阅读 · 0 评论 -
IOS图片压缩的类
IOS图片压缩的类,原创 2013-09-21 09:41:26 · 850 阅读 · 0 评论 -
优秀代码收集
1.点击一下确定,再点一下否定- (BOOL)didSelectedAction { _isSelect = !_isSelect; _nodePermission.selected = _isSelect; return_isSelect;} 2.安全删除集合中的元素思路:因为nsarray是动态变化的,所以要安全删除其转载 2013-09-21 09:47:48 · 830 阅读 · 0 评论 -
iOS开发中最有用关键的代码合集(1)
本文整理了,在iOS开发中我们所遇到一些开发问题的技巧类的代码,让你在开发过程中避免了很多弯路,希望能给你的开发带来帮助和启发。1.判断邮箱格式是否正确的代码: // 利用正则表达式验证 -( BOOL )isValidateEmail:( NSString *)email { NSString *emailRegex = @"[A-Z转载 2013-09-21 19:20:37 · 1188 阅读 · 0 评论 -
IOS GIF图片的解析
//加载gif 02 03 NSString *filePath = [[NSBundle mainBundle]pathForResource:@"bai3" ofType:@"gif"]; 04 05 NSData *data = [NSData dataWithContentsOfFile:filePath]; 06 07转载 2013-09-21 19:22:53 · 1509 阅读 · 0 评论 -
UINavigationBar-使用总结
多视图应用程序中,我们常常使用到自定义UINavigationBar来完成导航条的设置。1.获取导航条UINavigationBar *navBar = self.navigationController.navigationBar;2.设置导航条样式(使用系统自带样式)[navBar setBarStyl转载 2013-08-30 11:46:09 · 980 阅读 · 0 评论 -
IOS主题切换ThemeManager
//当前主题的名字@property (nonatomic, copy) NSString *themeName;//主题图片字典, 主题名字对应的文件路径@property (nonatomic, copy) NSDictionary *themeDic;//主题颜色字典@property(nonatomic, copy) NSDictionary *fontColorDic;原创 2013-08-30 11:35:21 · 1517 阅读 · 0 评论 -
ASIHTTPRequest-插件的使用
一、什么是ASIHTTPRequestASIHTTPRequest 插件是一个开源的第三方网络请求相关的插件!目前大多数关于网络请求的操作,我都使用它,简单,适用,方便,高效,给力!!!二、集成ASIHTTPRequest1、下载ASIHTTPRequest 插件包。下载地址:https://github.com/pokeb/as转载 2013-07-29 19:46:07 · 648 阅读 · 0 评论 -
presentModalViewController和dismissModalViewControllerAnimated的使用总结
在实际开发中,如果要弹出视图:我们常用到presentModalViewController方法和dismissModalViewControllerAnimated方法。presentModalViewController:弹出视图dismissModalViewControllerAnimated:隐藏视图贴代码:弹出视图:转载 2013-07-29 19:50:05 · 509 阅读 · 0 评论 -
宏定义(备用)
#define COOKBOOK_PURPLE_COLOR [UIColor colorWithRed:0.20392f green:0.19607f blue:0.61176f alpha:1.0f]#define BARBUTTON(TITLE, SELECTOR) [[[UIBarButtonItem alloc] initWithTitle:TITLE style:UIBarB原创 2013-07-28 17:39:22 · 758 阅读 · 0 评论 -
键盘的显示/隐藏-使用总结
应用中,跟用户交互功能必不可少!关于键盘的显示/隐藏 中,就隐藏着许多的知识。那我们就来窥看一角。我们常常抱怨这么几种情况:1.键盘显示时,遮盖了原来的输入框或者不该遮盖的内容。如何让其他控件不被键盘遮盖?2.键盘显示的动画与控件的位置移动不一致,导致动画不连贯。3.相反的,键盘隐藏时,其他控件该如何移动到原来的位置?等等。功能:转载 2013-07-29 19:52:00 · 783 阅读 · 0 评论 -
UIBarButtonItem-添加自定义Left或者Right按钮
为UINavigationController添加UINavigationItem,我们可以这样写:1.添加返回导航按钮backBarButtonItem1.用系统自带的返回按钮 UIBarButtonItem *leftBarButtonItem = [[UIBarButtonItem alloc]转载 2013-07-29 19:57:46 · 875 阅读 · 0 评论 -
BaseModel(数据模型映射关系)
#import "BaseModel.h"@implementation BaseModel-(id)initContentWithDic:(NSDictionary *)dic{ self = [super init]; if (self) { [self dicToObject:dic]; } return self;}原创 2013-07-24 13:14:24 · 1769 阅读 · 0 评论 -
NSNotificationCenter 的使用-iPhone成长之路
iPhone中NSNotificationCenter,的使用很简单。我们下面就看一看,通知的使用流程1.某个页面,发布了通知,告诉应用程序,通知的内容,及接到响应后,做出的操作。 // 注册通知-播放页面 [[NSNotificationCenter defaultCenter] addObserver:self转载 2013-08-07 21:26:13 · 722 阅读 · 0 评论 -
arc与非arc类 在同一工程如何共用~
/ 在ARC项目中使用非ARC框架,在非ARC项目中使用ARC框架在ARC项目中使用非ARC的框架解决方案:在target里的build phases中,找到compile sources,把涉及到非ARC的类,后面加上: -fno-objc-arc在非ARC的项目中加入ARC类库:如何在未使用arc的工程中引入一个使用了arc特性的文件:对相应的文件添加: -fo原创 2013-08-10 19:39:20 · 635 阅读 · 0 评论 -
项目常用代码
1.增加一个旋转动画 UIImage *loadImage = [UIImageimageNamed:@"detailLoad.png"]; UIImageView *loadImageView = [[[UIImageViewalloc]initWithImage:loadImage ]autorelease]; loadImageView.b转载 2013-08-10 19:40:20 · 715 阅读 · 0 评论 -
iOS 如何监听出插入耳机 拔掉耳机事件?
翻墙搜索后 我找到一个很好的办法 首先导入系统类库 #import //监听耳机事件 [[AVAudioSessionsharedInstance] setDelegate:self]; // Use this code instead to allow the app sound to continue to转载 2013-08-10 19:41:36 · 1007 阅读 · 0 评论 -
关于UITabBar各部分自定义的代码片段(转载)
转载自:http://www.cnblogs.com/lovecode/articles/2310977.html一、自定义TabBar选项卡背景默认UITabBarController的TabBar背景是黑色的,如何自定义成背景图片呢?UITabBarController *tabBarController = [[UITabBarController all转载 2013-08-10 19:52:09 · 1284 阅读 · 0 评论 -
iOS中定制导航栏背景
想定制导航栏吗?从iOS5开始你就可以改变导航栏的背景图片、tintcolor或者标题文本。这里我们将介绍如何在Xcode中定制导航栏。翻译 2013-08-11 16:39:22 · 1682 阅读 · 0 评论 -
图片的切割-UIImageView
UIImageView控件在app中的使用频率想我也不用多说。离不了!在展示图片时,往往需要展示网络的图片!图片缩放的背景 有时候,从互联网下载到的图片需要放在UIImageView中。但是我们app中需要的图片尺寸和比例不一定跟下载到的图片的尺寸和比例正好相等。这样的话,需要对网络的图片进行切割,来满足我们app中UIImageView控件的尺寸和比例。转载 2013-07-29 19:44:48 · 666 阅读 · 0 评论 -
GroupTableView
#pragma mark -- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{ return 3;}- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{ if (原创 2013-08-30 11:13:01 · 652 阅读 · 0 评论 -
UIView(Additions)
-(UIViewController *)viewController{ UIResponder *next = self.nextResponder; while (next != nil) { if ([next isKindOfClass:[UIViewController class]]) { return原创 2013-08-30 11:16:20 · 798 阅读 · 0 评论 -
IOS主页菜单通用代码
#pragma mark ViewCtrls-(void)initViewCtrls{ HomeViewController *home = [[HomeViewController alloc] init]; MessageViewController *msg = [[MessageViewController alloc] init]; ProfileViewCo原创 2013-08-30 11:20:36 · 819 阅读 · 0 评论 -
自定义的上拉加载更多
//加载更多 _moreButton = [UIButton buttonWithType:UIButtonTypeCustom]; _moreButton.backgroundColor = [UIColor clearColor]; _moreButton.frame = CGRectMake(0, 0, kScreenWidth, 40); _moreButt原创 2013-08-30 11:31:39 · 1013 阅读 · 0 评论 -
ios常用功能代码
1.增加一个旋转动画 UIImage *loadImage = [UIImageimageNamed:@"detailLoad.png"]; UIImageView *loadImageView = [[[UIImageViewalloc]initWithImage:loadImage ]autorelease]; loadImageView原创 2013-09-24 14:27:08 · 1075 阅读 · 0 评论