Why doesn't NSWorkspace's openURL open for more than one URL?
I have an action for a menu item that is supposed to open a URL base on the value of the 'lyricLink' property. It will work the first time (and all subsequent times where the value of 'lyricLink' is the same). But if the value of 'lyricLink' changes and the action is called again, it won't open the new link. Any ideas?
- (void)openLyricLink:(id)sender
{
[[NSWorkspace sharedWorkspace] openURL:[NSURL URLWithString开发者_运维技巧:[self lyricLink]]];
}
I think the first thing to check would be that [self lyricLink] is returning a valid string on the subsequent calls. I would add:
NSLog( @"lyricLink: %@", [ self lyricLink ] );
before calling NSWorkspace to see if lyricLink is a valid URL.
精彩评论