#define Nil __DARWIN_NULL  /* id of Nil class */
#define nil __DARWIN_NULL   /* id of Nil instance */
#define __DARWIN_NULL ((void *)0)
#define NULL ((void*)0)
例如想直接透過程式碼來呼叫按紐事件,由於並沒有經由按鈕來觸發,因此必須將輸入的參數設為空值。
 - (IBAction)onButton:(id)sender {
NSLog(@"hi");
}
 [self onButton:nil];
 
 
 
沒有留言:
張貼留言