尝试这个:
NSString * changeString = [NSString stringWithFormat:@"All calls to %@ are now forwarded to voicemail.\n Condition:\n %@ ",[[selected_phone_numbe stringByReplacingOccurrencesOfString:@"(" withString:@""] stringByReplacingOccurrencesOfString:@")" withString:@""] ,[[selectedOption stringByReplacingOccurrencesOfString:@"(" withString:@""] stringByReplacingOccurrencesOfString:@")" withString:@""]];
UIAlertView *callAlert = [[UIAlertView alloc] initWithTitle:@"Call Forward Enabled"
message:changeString
delegate:self cancelButtonTitle:@"Ok"
otherButtonTitles:nil, nil];
[callAlert show];
并检查此方法:
-(NSString *)replacingString:(NSString*)mainString removeString:(NSString *)rmString withReplace:(NSString*)rpString{
mainString = [mainString stringByReplacingOccurrencesOfString:rmString withString:rpString];
return mainString;
}
你得到了答案;
谢谢 :)