在日常開發(fā)中,我們會遇到一類問題就是保存qq號,并打開qq搜索好友离例,這里為了大家方便大年,通常都會將qq號幫助用戶復(fù)制好在剪切板中,這里用到的技術(shù)就是UIPasteboard
UIPasteboard *pab = [UIPasteboard generalPasteboard];
NSString *string = @"測試";
[pab setString:string];
if (pab == nil) {
[MBProgressHUD showError:@"復(fù)制失敗"];
}else{
[MBProgressHUD showSuccess:@"已復(fù)制"];
}