2011-08-11 2 views

답변

2

외부 라이브러리없이 작동 조금 해킹있다. 당신이 에서 유니 코드 URL이 theUrl 한 가정, 당신은 할 수 없다 :

NSURL *urlToLoad = nil; 
NSPasteboard * pasteboard = [NSPasteboard pasteboardWithName:@"RandomPB"]; 
[pasteboard declareTypes:[NSArray arrayWithObject:NSStringPboardType] owner:nil]; 
@try 
{ 
    if ([pasteboard setString:theUrl forType:NSStringPboardType]) 
     urlToLoad = [WebView URLFromPasteboard:pasteboard]; 
} 
@catch (NSException * exception) 
{ 
    urlToLoad = nil; 
    NSLog(@"Can't create URL from string '%@'.", theUrl); 
} 
return urlToLoad; 
관련 문제