Iphone “什么是”呢;“自我”;“那”是怎么回事;“视图”;使用的财产?
在这方面:Iphone “什么是”呢;“自我”;“那”是怎么回事;“视图”;使用的财产?,iphone,objective-c,self,Iphone,Objective C,Self,在这方面: -(IBAction)buttonClick: (id)sender { UIActionSheet *actionSheet = [[UIActionSheet alloc] initWithTitle:@"Fo Sho?" delegate:self cancelButt
-(IBAction)buttonClick: (id)sender {
UIActionSheet *actionSheet = [[UIActionSheet alloc]
initWithTitle:@"Fo Sho?"
delegate:self
cancelButtonTitle:@"Cancel"
destructiveButtonTitle:@"fo sho"
otherButtonTitles:nil];
[actionSheet showInView:self.view];
}
[myString length]
时,length
消息中的self
指针就是指向名为myString
的字符串的指针
-(void)logScore
{
NSLog(@"%@ score is %d", self.name, self.score);
}
[player logScore];
在本例中,
self
是player
对象。投票结束,因为这很可能是重复的:与另一个问题完全相同,也很接近:在我的具体示例中如何?它是UIButton还是UIView或UIViewController?若buttonClick是视图控制器的方法,那个么它将是视图控制器。如果buttonClick是视图的方法,那么它将是视图。它将是您向我们显示的#buttonClick:
-方法所属的类的实例。很可能是一个UIViewController
,但由于您没有向我们显示更多的代码,这只是一个猜测