苹果开发者联盟的网址:http://www.apple.com.cn/developer/

objective-C on the Mac     (Aoress)       作者:Dakrymple Scott Knadter                                              

动态创建按钮的代码:

UIButton *Mybutton = [[UIButton alloc ]  initWithFrame:aRect]

 

@property 关键字后面紧跟一些可选的属性(位于圆括号里面)它进一步定义了编译器如何创建访问方法和修改方法

@property (retain , nonatomic) UILable * statusText

 

@systhesize statusText

@systhesize通知编译器自动为我们创建访问方法和修改方法,添加了次行代码之后,我们的类中已存在两个不可见的方法:statusText和 setStatusText,我们并没有编写这两个方法,他们是制动创建的。自己在试验中发现,要想使用systhesize属性,必须有property(retain)。

 

用户控件共有3种基本的形式:活动、静态、和被动。按钮是活动的控件,点击它可以出发一段代码,标签是静态控件,可以通过代码修改它,但用户不能对其进行任何操作,被动控件紧用于存储用户输入值,直到完成为止,这些控件不触发任何操作,但可以和用户交互,例如网页上的文本

NSCustomImageRep

 

NSPDFImageRep

别人再好,关我什么事。我再不好,关别人什么事。有些事,不是我不在乎,而是我在乎了又能怎样?

NSPageController

关于证书的类:SecCertificateRef,SFCertificatePanel,

SFChooseIdentityPanel

证书选择的过程:

首先是使用runModalForIdentities函数建立SFChooseIdetifyPanel对话框,这个函数的定义如下

- (NSInteger)runModalForIdentities:(NSArray *)identities message:(NSString *)message

参数:idetititis:

An array of identity objects (objects of type SecIdentityRef. Use the SecIdentitySearchCopyNext function (in Security/SecIdentitySearch.h) to find identity objects.

message

A message string to display in the panel.

注意:This method returns NSOKButton if the default button is clicked, or NSCancelButton if the alternate button is clicked.

Use the identity method to obtain the identity chosen by the user.

下面的问题就是如何获得identities了,他是SecIdentityRef类型的,那么问题就转化为如何初始化这个对象呢?SecIdentityRef的定义如下:

typedef struct __SecIdentity *SecIdentityRef;

A SecIdentityRef object contains a SecKeyRef object and an associated SecCertificateRef object.

文档中说使用函数获取SecIdentityRef结构体类型的变量,那么这个函数的定义如下

SecIdentitySearchCopyNext

Finds the next identity matching specified search criteria (Deprecated in OS X v10.7.)

OSStatus SecIdentitySearchCopyNext (
SecIdentitySearchRef searchRef,
SecIdentityRef *identity
);
Parameters
searchRef

An identity search object specifying the search criteria for this search. You create the identity search object by calling theSecIdentitySearchCreate function.

identity

On return, points to the identity object of the next matching identity (if any). Call the CFRelease function to release this object when finished with it.

Return Value

A result code. When there are no more identities that match the parameters specified to SecIdentitySearchCreate, errSecItemNotFound is returned. See “Certificate, Key, and Trust Services Result Codes.”

iphone学习的更多相关文章

  1. iOS/iPhone学习系列、代码教程

    part 1--入门: 1. xcode 版本下载 以及 iphone sdk 下载: 最新版本在此下载: http://developer.apple.com/devcenter/ios/index ...

  2. 非常优秀的iphone学习文章总结!

    This site contains a ton of fun tutorials – so many that they were becoming hard to find! So I put t ...

  3. 一些iOS高效开源类库

    因为iOS SDK相对比较底层,所以开发者就得受累多做一些体力活.不过幸运的是,有很多第三方的类库可以用来简化很多不必要的工作.笔者整理了一下在本人学习过程中用到的一些比较有用Objective-C开 ...

  4. 虚拟机IOS开发环境搭建教程

    来源:http://www.cnblogs.com/xiaoyaoju/archive/2013/05/21/3091171.html 安装条件: 硬件:一台拥有支持虚拟技术的64位双核处理器和2GB ...

  5. windows下利用VMware安装mac:构建…

    安装条件: 硬件:一台拥有支持虚拟技术的64位双核处理器和2GB以上内存的PC. 注意:运行MAC OS,需要电脑支持虚拟技术(VT),安装时,需要将VT启动,在BIOS中开启. 关于如何检测你的电脑 ...

  6. iPhone应用开发 UITableView学习点滴详解

    iPhone应用开发 UITableView学习点滴详解是本文要介绍的内容,内容不多,主要是以代码实现UITableView的学习点滴,我们来看内容. -.建立 UITableView DataTab ...

  7. 我常用的iphone开发学习网站[原创]

    引用地址:http://www.cnblogs.com/fuleying/archive/2011/08/13/2137032.html Google 翻译 Box2d 托德的Box2D的教程! Bo ...

  8. ios学习--iphone 实现下拉菜单

    原文地址:ios学习--iphone 实现下拉菜单作者:sdglyuan00 #import @interface DropDown1 : UIView <</span>UITabl ...

  9. iPhone深度学习-ARM

    平台 xCode 5.0 iPhone 4 在Building setting中的 Architectures 部分,有这么一个选项 Architectures,这里有一些选项是 Armv7 和Arm ...

随机推荐

  1. Java多线程(五)停止线程 interrupt

    调用interrupt方法仅仅是在当前线程中打了一个停止的标记,并不是真正停止线程. this.interrupted() :测试当前线程是否已经中断,执行后具有将状态标志清除为false的功能 is ...

  2. Java多线程(三)SimpleDateFormat

    多线程报错:java.lang.NumberFormatException: multiple points SimpleDateFormat是非线程安全的,在多线程情况下会有问题,在每个线程下得各自 ...

  3. srand()

    //第一次:5 0 第二次:5 16 srand(); //seed为常数,则每次运行产生的随机数一样 printf(); //产生的随机数都是一样的,都是5 srand(time(NULL)); p ...

  4. [ SPOJ Qtree1 ] Query on a tree

    \(\\\) Description 给定 \(n\) 个点的树,边按输入顺序编号为\(1,2,...n-1\) . 现要求按顺序执行以下操作(共 \(m\) 次): \(CHANGE\ i\ t_i ...

  5. python 模块-easygui.buttonbox

    2018-03-0315:43:11 ): Yes_or_No = easygui.buttonbox("是否良品?", choices=['Yes', 'No', '退出']) ...

  6. css的新特性 calc () 使用

    calc()对大家来说,或许很陌生,不太会相信calc()是css中的部分.因为看其外表像个函数,既然是函数为何又出现在CSS中呢?这一点也让我百思不得其解,今天有一同事告诉我,说CSS3中有一个属性 ...

  7. python行与缩进

    #python行与缩进 1.了解逻辑行与物理行 2.行中分号使用规则 3.行链接 4.什么是缩进 5.如何缩进 6.注释 1.python中逻辑行主要是指一段代码,在意义上它的行数,而物理行,指的是我 ...

  8. Java 基础入门随笔(6) JavaSE版——数组操作

    1.数组 概念:同一种类型数据的集合.其实就是数组就是一个容器. 好处:可以自动给数组中的元素从0开始编号,方便操作这些元素. 格式: ①. 元素类型[] 数组名 = new 元素类型[元素个数或数组 ...

  9. 踩过好多次的坑 - ajax访问【mango】项目的service

    这个坑真的是踩过好多次了,好记性不如烂笔头,我总是太高估我的记忆力,这次真的是要写下来了. 项目是用的seam框架 + hibernate搭建的,架构是前辈们搭好的劳动成果,在配置service的访问 ...

  10. 牛客多校Round 10

    咕咕咕.... 去烽火台和兵马俑了