自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(35)
  • 收藏
  • 关注

转载 允许未经证实的SSL证书中的UIWebView

I'm embedding a website in a UIWebView.我的网站嵌入在一个UIWebView。 During development I have it pointed at localhost.在发展过程中,我已经指出在localhost。The problem is that whenever it hits a "https://" url it doesn't

2013-11-28 23:33:03 2324

转载 NSURLConnection详解

通常在IPhone里用网络访问会用到NSURLConnection来做url链接请求,下面简单介绍一下:  1、同步请求               NSURL *url=[[NSURL alloc]initWithString:urlString];      NSMutableURLRequest  *request=[[NSMutableURLRequest alloc]init

2013-11-28 22:37:39 2282

转载 NSURLCredential 身份认证

web 服务可以在返回 http 响应时附带认证要求 challenge,作用是询问 http 请求的发起方是谁,这时发起方应提供正确的用户名和密码(即认证信息),然后 web 服务才会返回真正的 http 响应。        收到认证要求时,NSURLConnection 的委托对象会收到相应的消息并得到一个 NSURLAuthenticationChallenge 实例。

2013-11-28 22:24:10 11656

转载 scheduleInRunLoop的作用

1 NSURLRequest *request = ...  2 NSURLConnection *connection = [[NSURLConnection alloc]                                 initWithRequest:request                                 delegate:self   

2013-11-28 22:15:29 2782

转载 一个iOS 框架介绍:MKNetworkKit

ASIHTTPRequest (作者:BenCopsey) 是一个使用简单,可用于各种从简单到复杂的 HTTP 请求,或者可用于处理 Amazon S3、Rackspace 等REST 服务的强大框架。不幸的是,Ben 早在 2011 年 9 月 21 日就已经声明停止开发和支持该框架(见http://allseeing-i.com/%5Brequest_release%5D; )。

2013-11-27 20:40:50 772

转载 UIScrollView resuing three view

#pragma mark - UIScrollView Delegates- (void)scrollViewDidScroll:(UIScrollView *)scrollView{    int selectedPage = roundf(newsPagesView.contentOffset.x/_pageWidth);    if (selectedPage !

2013-11-20 21:44:02 831

转载 UIImageJPEGRepresentation和UIImagePNGRepresentation

在Iphone上有两种读取图片数据的简单方法: UIImageJPEGRepresentation和UIImagePNGRepresentation. UIImageJPEGRepresentation函数需要两个参数:图片的引用和压缩系数.而UIImagePNGRepresentation只需要图片引用作为参数.通过在实际使用过程中,比较发现: UIImagePNGRepresentat

2013-11-19 21:45:55 1110

转载 ios Screenshot

-(void)fullScreenshots{UIWindow *screenWindow = [[UIApplication sharedApplication] keyWindow];    UIGraphicsBeginImageContext(screenWindow.frame.size);//全屏截图,包括window    [screenWindow.la

2013-11-19 21:37:06 934

转载 ios image resize

1.  UIGraphicsBeginImageContext(newSize);[image drawInRect:CGRectMake(0,0,newSize.width,newSize.height)];UIImage* newImage = UIGraphicsGetImageFromCurrentImageContext();UIGraphicsEndImageCont

2013-11-19 21:34:41 966

转载 ios image compress

CGFloat compression = 0.9f;CGFloat maxCompression = 0.1f;int maxFileSize = 250*1024;NSData *imageData = UIImageJPEGRepresentation(yourImage, compression);while ([imageData length] > maxFileSize

2013-11-19 21:33:21 1562

原创 ios image resize

UIGraphicsBeginImageContext(newSize);[image drawInRect:CGRectMake(0,0,newSize.width,newSize.height)];UIImage* newImage = UIGraphicsGetImageFromCurrentImageContext();UIGraphicsEndImageContext();

2013-11-19 21:32:31 904

转载 ios address book 操作大全

为了调用系统的通讯录界面与相应功能,需要引入AddressBook.framework同时,在源文件中需要包含同文件:[html] view plaincopy#import AddressBook/AddressBook.h>  #import AddressBookUI/AddressBookUI.h>  

2013-11-19 21:16:55 8729

转载 ios address book

对于系统的contact 联系簿的ViewController 如何使用,下面又一个官方的demo,大家可以拿去看看。这个东西,找了一段时间。其实不是很难,配合自己写的数据模型,很容易就能做出好的功能。只不过UI这块就要差一点了。下面是一个类的h和m文件,大家自己把他搭建好,app delegate自己搭下,加入到一个NavigationController中即可。不需要其他的co

2013-11-19 21:13:23 1402

转载 How To Send SMS Text Message in iPhone Apps

This is a quick follow-up to the previous post on email attachment. Some of you mentioned if we can write a short tutorial about sending SMS text messages within iOS apps. So here we go.Not only

2013-11-16 21:41:36 1812

转载 Local Notifications and Push Notifications

Scheduling, Registering, and Handling NotificationsThis chapter describes the tasks that an iOS on OS X application should (or might) do to schedule local notifications, register remote notificati

2013-11-16 13:41:19 16502

转载 一步一步实现iOS应用PUSH功能

1. push原理iOS push 工作机制可以用下图简要概括Provider:应用自己的服务器;APNS:Apple Push Notification Service的简称,苹果的PUSH服务器;push的主要工作流程是:iOS设备连接网络后,会自动与APNS保持类似TCP的长链接,等待APNS推送消息的到来;应用启动时注册消息推送,

2013-11-16 12:37:58 1499

转载 iphone 推送服务--Apple Push Notification Service

标注:APNs 苹果推送服务器Device 安装带有推送服务程序的iPhone手机Provider 程序服务器,把需要推送的信息发给 APNsDeviceToken  在Device第一次连接APNs时,由APNs生成的经过加密的连接认证信息。在以后的连接中,无论时Provider到APNs还是APNs到Device 都需要 DeviceToken作为认证。Payload  需要推

2013-11-16 12:29:10 820

转载 UIAlertView add UITextField

UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:question message:@"\n" delegate:madelegate cancelButtonTitle:button1 otherButtonTitles:button2, nil];// Build text fieldUITextField

2013-11-15 22:17:18 837

转载 client push example

#import #import "TestBedViewController.h"#define COOKBOOK_PURPLE_COLOR [UIColor colorWithRed:0.20392f green:0.19607f blue:0.61176f alpha:1.0f]#define BARBUTTON(TITLE, SELECTOR) [[[UIBarButto

2013-11-14 22:35:34 1465

原创 Capture UITableView Touch Event

1.继承UITableView2.在继承的类中添加delegate3.在继承的类中重写touch的方法

2013-11-11 22:37:49 597

转载 KVO

一,概述KVO,即:Key-Value Observing,它提供一种机制,当指定的对象的属性被修改后,则对象就会接受到通知。简单的说就是每次指定的被观察的对象的属性被修改后,KVO就会自动通知相应的观察者了。二,使用方法系统框架已经支持KVO,所以程序员在使用的时候非常简单。1. 注册,指定被观察者的属性,2. 实现回调方法3. 移除观察三

2013-11-10 18:03:26 453

转载 UIActionSheet+Blocks

UIActionSheet+Blocks.h  @@ -0,0 +1,57 @@  +//  +//  UIActionSheet+Blocks.h  +//  +//  Created 

2013-11-10 14:22:20 1630

原创 设置UIBarButtonItem appearance

1.[[UIBarButtonItem appearance]  setTintColor:[UIColor redColor]];2.[[UIBarButtonItem appearanceWhenContainedIn:[UINavigationbar class], nil]  setTintColor:[UIColor redColor]];

2013-11-10 14:06:28 1030

原创 UIAlertView+Blocks

////  UIAlertView+Blocks.h//  UIKitCategoryAdditions//#import typedef void (^DismissBlock)(int buttonIndex);typedef void (^CancelBlock)();@interface UIAlertView (Blocks)

2013-11-10 13:34:31 1909

转载 UIAlertView(BlocksKit) Category Reference

用block代替delegateUIAlertView without delegates!This set of extensions and convenience classes allows for an instance of UIAlertView without the implementation of a delegate. Any time you instantiat

2013-11-10 13:14:50 2218

原创 并发程序块

分派组:将在一个组的上下文通过dispatch_ground_async()函数异步分派所有程序块设置为松散的,以尽可能快的执行,如果可能,将它们分发给多个线程来同时执行。也可以使用dispatch_ground_notify指定一个额外的程序块,该程序块在组中的所有程序块即将运行完成时执行。eg:dispatch_async(dispatch_get_global_queue(0,0),

2013-11-09 14:35:32 828

转载 iOS应用程序生命周期(前后台切换,应用的各种状态)详解

iOS的应用程序的生命周期,还有程序是运行在前台还是后台,应用程序各个状态的变换,这些对于开发者来说都是很重要的。 iOS系统的资源是有限的,应用程序在前台和在后台的状态是不一样的。在后台时,程序会受到系统的很多限制,这样可以提高电池的使用和用户体验。//开发app,我们要遵循apple公司的一些指导原则,原则如下:1、应用程序的状态状态如下:Not running  

2013-11-09 12:01:10 3451

转载 IOS的后台运行

IOS的后台运行文一 我从苹果文档中得知,一般的应用在进入后台的时候可以获取一定时间来运行相关任务,也就是说可以在后台运行一小段时间。 还有三种类型的可以运行在后以, 1.音乐 2.location 3.voip 文二 在IOS后台执行是本文要介绍的内容,大多数应用程序进入后台状态不久后转入暂停状态。在这种状态下,应用程序不执行任何代码,并有可能在任意时

2013-11-09 11:56:32 892

原创 ios block的简单用法

#import // 定义Blocks的typedeftypedef int (^SumBlockT) (int a, int b);int main (int argc, const char * argv[]){    @autoreleasepool {                // insert code here...        NSLog(

2013-11-07 23:22:36 651

原创 nsarray nsdictionary nsset基于block的枚举

NSArray *dataArray = [NSArray arrayWithObjects:@"this", @"is", @"a", @"cat", nil];NSString *findString = @"cat";[dataArray enumerateObjectsUsingBlock:^(id, object, NSUInteger index, BOOL*stop)

2013-11-07 23:09:27 1295

转载 NSDictionary里的keysSortedByValueUsingSelector排序使用

NSDictionary里的keysSortedByValueUsingSelector排序使用@implementation NSString(compare)  -(NSComparisonResult)floatCompare:(NSString*)other{float myValue = [self floatValue];float otherV

2013-11-07 22:24:48 6181

转载 ios block

iOS4已经直接支持blocks,很有必要学习一下。在ios中,将blocks当成对象来处理,它封装了一段代码,这段代码可以在任何时候执行。Blocks可以作为函数参数或者函数的返回值,而其本身又可以带输入参数或返回值。它和传统的函数指针很类似,但是有区别:blocks是inline的,并且它对局部变量是只读的。Blocks的定义:       [cpp] 

2013-11-07 20:18:20 674

转载 UINavigationController使用详解

UINavigationController使用详解  有一阵子没有写随笔,感觉有点儿手生。一个多月以后终于又一次坐下来静下心写随笔,记录自己的学习笔记,也希望能够帮到大家。  废话少说回到正题,UINavigationController是IOS编程中比较常用的一种容器view controller,很多系统的控件(如UIImagePickerViewController)以及很

2013-11-06 23:57:28 571

转载 local notification

概述苹果公司为了确保IOS设备能在任何时候都能快速响应,保证用户体验,对后台运行的应用程序进行了限制。在IOS4以后,对第三方应用程序开放了后台处理,但在开放后台处理面很谨慎,只对一组用户经常遇到的任务开放。IOS支持的后台处理主要有四种类型:1.挂起暂停执行代码,保留当前状态。用户返回应用程序时看起来一直在运行,实际上为了不让其

2013-11-02 20:20:58 750

转载 ios local notification

做了很多有Push Notification和Locale Notification的app,来整理下开发的笔记。今天先说说Local Notification在iOS4.0后Apple加入了Local Notification。这里是NSLocaleNotification的Class Reference http://developer.apple.com/library/ios/#d

2013-11-02 18:52:28 1473

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除