zoukankan      html  css  js  c++  java
  • iphone学习

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

  • 相关阅读:
    HDU 4268 multiset
    ACM-线段树
    HDU 5014 异或之和
    HDU 5012 骰子旋转(DFS)
    HDU 5011 NIM博弈
    HDU 5007 字符串匹配
    Android-Context
    Android-视图绘制
    Android-LayoutInflater
    oracle--分页过程demo1
  • 原文地址:https://www.cnblogs.com/watchdatalearn2012620/p/3182527.html
Copyright © 2011-2022 走看看