IOS中的方法

2015-12-11  本文已影响26人  shanshan950224

在IOS中系统的方法名较长,但是易读,例如:

-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{     
 }

自定义方法:


-(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{ 
return 1;
}


-(IBAction)clickBtn:(id)sender{

  // 点击事件的方法
  
  }

其中与xib链接时,链接成功显示实心点,还有时未连接上显示空心点。


 + 类方法   [类名  方法名]调用
`UIView *topView = UIView.new; `
 - 对象放方法  [实例对象   方法名]调用
`UIView *(-方法) = UIView.new; `

星后面的就为对象 

上一篇 下一篇

猜你喜欢

热点阅读