Heim > Fragen und Antworten > Hauptteil
Der Code lautet wie folgt:
/**
跳转到微信,并打开指定的URL
@return <#return value description#>
*/
+(BOOL) openWeChat:(NSString *)url
{
//wx0b577bb0399ff7d7
NSString *headString = @"weixin://";
headString = [headString stringByAppendingString:url];
BOOL canOpen = [[UIApplication sharedApplication] canOpenURL:[NSURL URLWithString:@"weixin:/"]];
if(canOpen)
//打开微信
return [[UIApplication sharedApplication] openURL:[NSURL URLWithString:headString]];
return FALSE;
}