can't open image with NSOpenPanel
问题 I use below code for open image with NSOpenPanel but doesn't work //panel=NSOpenPanel NSString *imgg = [NSString stringWithFormat:@"%@",panel.URL]; self.imgUser.image=[NSImage imageNamed:imgg]; 回答1: The problem is that +[NSImage imageNamed:] doesn't load an image by URL. If you read the documentation, it explains what it actually does: it looks for an image stored in the cache under that name, or stored in the app's bundle or AppKit's framework under that filename. There are a large number of