03 2014 档案

摘要:本节目录category理解category例子category理解1.给现在的类增加功能,如添加方法2.分类不能添加成员变量3.文件中的语法@interface 主类类名(分类类名)4.文件名通常为:主类名+分类名5.引用是要import分类category例子在OC中我觉得URL编码的方法太长了,我想缩短点,于是给字符串URL编码、URL解码新起方法#import @interface NSString (Extend)-(NSString *)urlEncode;-(NSString *)urlDecode;@end#import "NSString+Extend.h" 阅读全文
posted @ 2014-03-19 23:11 Vincent_Guo 阅读(468) 评论(0) 推荐(0)
摘要:前言:对于一个学习IT知识的人来说,图文并茂来说明知识是比较易于理解。想简单的理解HTTPS,先要理解下非对称加密和对称加密HTTPS交互过程如下图1、Client发送一个请求到Server2、Server会生成私钥和公钥3、服务器会生成一个证书返回给客户端,这个证书里包括Server生成的公钥、颁发日期、过期时间等信息。4、服务器会验证这个证书是否有效合法5、如果证书有效,Client会生成一个Key(这个key用于以后的数据加密)。6、Client用证书里面的公钥对Key进行加密并上传到Server7、Server用私钥对Client传过来的key进行解密8、Server用key加密数据, 阅读全文
posted @ 2014-03-19 15:58 Vincent_Guo 阅读(547) 评论(0) 推荐(0)
摘要:本节目录protocol理解protocol案例protocol理解protocol是协议的意思,可以理解成定义规则,就是你必须跟着我的规则走,否则不是乱套了对吧。protocol案例我们添加一个Button类,声明一个Button监听的协议,然后用户通过这个协议来实现按钮监听Button.h#import //声明一个代理,后面才定义@protocol ButtonDelegate;@interface Button : NSObject//按钮的点击方法-(void)click;//代理就是监听器,当用户点击时通过代理通知用户@property(nonatomic,assign)id de 阅读全文
posted @ 2014-03-18 18:43 Vincent_Guo 阅读(233) 评论(0) 推荐(0)
摘要:本节目录autorelease静态创建实例 autorelease添加了autorelease后就不用再用release代码,它会自己释放#import #import "Book.h"#import "Student.h"int main(int argc, const char * argv[]){ @autoreleasepool { Book *book = [[[Book alloc] init] autorelease]; } return 0;}可以看到程序运行结束会Book被销毁2014-03-18 18:11... 阅读全文
posted @ 2014-03-18 18:13 Vincent_Guo 阅读(196) 评论(0) 推荐(0)
摘要:android读取短信比较简单,我们可以分类读取短信,比如所有短信,收件箱短信,发件箱短信,草稿笨短信注:读取短信时,一定要指明要读哪些字段package com.test.testmsg;import java.text.ParseException;import java.text.SimpleDateFormat;import java.util.Date;import android.net.Uri;import android.os.Bundle;import android.app.Activity;import android.content.Context;import and 阅读全文
posted @ 2014-03-18 17:28 Vincent_Guo 阅读(1184) 评论(0) 推荐(0)
摘要:通俗理解动态与静态广播监听动态广播监听是在Activity,通过代码调用registerReceiver和unregisterReceiver来注册或者释注销听对象表态广播监听是在AndoridMainfest.xml文件去注册一个广播监听,由系统去注销监听总结:动态与静态如何区分,捉住是通过代码还是.xml去配置动态注册短信监听需求:我有一个注册页面,里面有个验证码字段是会发送到手机,我要在activity里监听验证短信并获取验证码注:要接收短信监听,要授于短信接收的用户权限 然后注册广播package com.test.testmsg;import android.net.Uri;imp. 阅读全文
posted @ 2014-03-18 17:22 Vincent_Guo 阅读(663) 评论(0) 推荐(0)
摘要:本节目录retainassigncopyretain先建一个student类,和一个Book类,学生拥有有一本书Book.m#import "Book.h"@implementation Book-(void)dealloc{ NSLog(@"Book 被销毁"); [super dealloc];}@endStudent.h,nonatomic先不理,后面来讲#import #import "Book.h"@interface Student : NSObject@property(nonatomic,retain)Book *bo 阅读全文
posted @ 2014-03-17 18:06 Vincent_Guo 阅读(394) 评论(0) 推荐(0)
摘要:本节内容dealloc方法retain方法一、dealloc方法当一个对象被销毁释放时,会调用dealloc方法在Staff类中重写下dealloc方法,记住,最后得调用父亲的dealloc方法,因为父类可能还有些对象有释放#import "Staff.h"@implementation Staff-(void)dealloc{ NSLog(@"Staff 被销毁"); [super dealloc];}@end#import #import "Staff.h"int main(int argc, const char * argv[ 阅读全文
posted @ 2014-03-17 16:46 Vincent_Guo 阅读(303) 评论(0) 推荐(0)
摘要:本节目录@property@synthesize@property前面写一个age属性,又要写set/get方法,比较麻烦,@property就是简化操作的Staff.h#import @interface Staff : NSObject@property int age;@end上面的代码等效于在头文件声明了age的set/和get方法-(void)setAge:(int)newAge;-(int)age;@synthesize在头文件声明了age的set/get方法后,在点.m文件中要实现get/set方法,@synthesize就是自动来为你做这事的。Staff.m#import &q 阅读全文
posted @ 2014-03-17 16:11 Vincent_Guo 阅读(223) 评论(0) 推荐(0)
摘要:1. Terms and conditions(法律与条款)1.1As a developer of applications for the App Store you are bound by the terms of theProgram License Agreement(PLA), Human Interface Guidelines (HIG), and any other licenses or contracts between you and Apple. The following rules and examples are intended to assist you 阅读全文
posted @ 2014-03-11 21:57 Vincent_Guo
摘要:前言:最近一直在学习macbook怎么配个svn服务端,先来讲下思路。svn包括服务端和客户端,那首先我们要安装svn的服务端,再安装svn的客户端。一、svn的服务端安装查找了一些资料,网上说在macbook上是已经安装了服务端的,大家在命令窗口输入svn 或者svnadmin,有这个命令代表你的电脑已经安装服务端了。没有的话就要自己安装,可以利用xcode来安装选择xcode -- Preferences -- Download,如下图,如果Command Lind Tools没有安装,就请你安装下,安装完后就会有svn和svnadmin命令了二、svn服务端配置1. 创建一个文件目录/i 阅读全文
posted @ 2014-03-08 21:51 Vincent_Guo
摘要:前言:个人开发者发布应用到APP STORE需要几个步骤在certificates,identifiers,&profiles中生成production证书登录iTunes Connect添加要发布的应用信息打在Xcode使用Porduct->Archiver进行打包发布一、在certificates,identifiers,&profiles中生成production证书 这里生成证书的步骤就不再写了,大家可以参照博客的苹果开发者平台-《测试证书》生成流程只要把里面的Development改成 Production就可以了二、登录iTunes Connect添加要发布的 阅读全文
posted @ 2014-03-02 17:48 Vincent_Guo 阅读(1769) 评论(0) 推荐(0)