苹果开发者联盟的网址: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.”

最新文章

  1. 【每日一linux命令3】参数(或称选项)顺序
  2. BZOJ 1221: [HNOI2001] 软件开发
  3. 浅谈AOP
  4. linux rpm问题:怎样查看rpm安装包的安装路径
  5. sql server 对象资源管理器(一)
  6. Win7系统下VS2008安装SP1补丁解决JQuery无智能提示的问题
  7. 【CF】7 Beta Round D. Palindrome Degree
  8. Django 数据库查询
  9. TDD测试驱动的javascript开发(3) ------ javascript的继承
  10. 服务端事件EventSource揭秘
  11. java读写锁ReadWriteLock
  12. Java中net.sf.json包关于JSON与对象互转的问题
  13. VUE脚手架搭建
  14. STM32f4 ARM Bootloader
  15. PyTorch官方中文文档:torch.optim
  16. EF Like
  17. 《SQL 基础教程》第四章:数据更新
  18. 解决bootstrap和easyUI部分css类冲突问题。
  19. Mybatis高级应用-2
  20. PAT 1015 德才论 (25)(代码+思路)

热门文章

  1. vs2017 + miniUI + dapper 添加、修改、删除、查询操作
  2. C# 文件操作(摘抄)
  3. Python学习日记之运算符
  4. Selenium学习第二天,了解Selenium工作模式与学习Selenium需要具备的知识与工具。
  5. React组件的防呆机制(propTypes)
  6. 语音跟踪:信号分解、锁相、鸡尾酒会效应、基于PR的信号分离
  7. Vue指令4:v-on
  8. 通过Oracle函数SQL实现C# String.Format字符串格式化功能
  9. nginx+keepalived+tomcat+memcache实现双VIP高可用及Session会话保持
  10. Extjs查询实现