开发者

Application:openFiles: separate files by groups

I need that my application detect how many files has been dropped to it dock ic开发者_开发问答on. For this i use application:openFiles: method

- (void)application:(NSApplication *)sender openFiles:(NSArray *)filenames
{
  NSLog(@"%d",[filenames count]);
}

But unfortunately files sometimes separates by group. So, for example i dragged 3 files to dock icon and get this output:

2
1

How could it be?


Unfortunately that's life. If you really need to count the number of files received in a drop to the Dock icon, you need to set up a timer to combine the results received by the call application:openFiles: within a second (or some appropriate length of time.)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜