oneway modifier objective c

只愿长相守 提交于 2019-12-25 19:03:05

问题


a oneway method is asynchronous (the result is not immediately expected)[1]. oneway is used with the distributed objects API. [2]

But i found below code in SCPlugin

+ (oneway void) executeShellCommandAsynchronously:(NSString*)command
{
    [[self taskForShellCommand:command] launch];

    return;
}

+ (void) refreshAllFinderItems
{
    //code
    if (cmd) {
        [ShellTask executeShellCommandAsynchronously:cmd];
    }
}

will oneway behave same in cocoa application(without distributed object)?


回答1:


Yes. Just because it isn't a part of the distributed objects API, does not mean it won't function in the same way. The keyword is a compiler hint, and not much else.



来源:https://stackoverflow.com/questions/9597340/oneway-modifier-objective-c

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!