相关疑难解决方法(0)

iPhone SDK Objective C是否支持函数内部的功能?

我知道javascript,例如支持函数内部的函数,如下所示:

function doSomething(){

  function doAnothingThing(){
    //this function is redefined every time doSomething() is called and only exists inside doSomething()    
  }

  //you can also stick it inside of conditions

  if(yes){
    function doSomethingElse(){
      //this function only exists if yes is true
    }
  }


}
Run Code Online (Sandbox Code Playgroud)

Objective-c是否支持此功能?理论范例:

 -(void) doSomething:(id) sender{
   -(void) respondToEvent: (id) sender{
     //theoretically? ... please?
   }
}
Run Code Online (Sandbox Code Playgroud)

奖励:"本地"功能的正确用语是什么?

iphone methods objective-c messages

6
推荐指数
3
解决办法
3527
查看次数

标签 统计

iphone ×1

messages ×1

methods ×1

objective-c ×1