我知道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)
奖励:"本地"功能的正确用语是什么?