// 繼承UITextView重寫這個方法
- (BOOL)canPerformAction:(SEL)action withSender:(id)sender
{
? ? // 返回NO為禁用脯丝,YES為開啟
? ? // 粘貼
? ? if(action ==@selector(paste:))returnNO;
? ? // 剪切
? ? if(action ==@selector(cut:))returnNO;
? ? // 復(fù)制
? ? if(action ==@selector(copy:))returnNO;
? ? // 選擇
? ? if(action ==@selector(select:))returnNO;
? ? // 選中全部
? ? if(action ==@selector(selectAll:))returnNO;
? ? // 刪除
? ? if(action ==@selector(delete:))returnNO;
? ? // 分享
? ? if(action ==@selector(share))returnNO;
? ? return[supercanPerformAction:action withSender:sender];
}