我想从我的应用程序中分享一个Url链接和一些短信到WhatsApp.我该如何分享内容?
我得到的代码只有文字
NSString * msg = @"Trueman India Magazine";
NSString * urlWhats = [NSString stringWithFormat:@"whatsapp://send?text=%@",msg];
NSURL * whatsappURL = [NSURL URLWithString:[urlWhats stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]];
if ([[UIApplication sharedApplication] canOpenURL: whatsappURL])
{
[[UIApplication sharedApplication] openURL: whatsappURL];
}
Run Code Online (Sandbox Code Playgroud)
但我如何在WhatsApp中分享我的网址链接?
我是iOS开发中的新手我想在iOS中的MKMapViewController中显示多个注释,因为我在viewDidLoad方法中编写代码
- (void)viewDidLoad
{
[super viewDidLoad];
self.mapView.delegate=self;
NSArray *name=[[NSArray alloc]initWithObjects:
@"VelaCherry",
@"Perungudi",
@"Tharamani", nil];
self.annotation=[[NSMutableArray alloc]initWithCapacity:[name count]];
MKPointAnnotation *mappin=[[MKPointAnnotation alloc]init];
CLLocationCoordinate2D location;
location.latitude=(double)12.970760345459;
location.longitude=(double)80.2190093994141;
mappin.coordinate=location;
mappin.title=[name objectAtIndex:0];
[self.annotation addObject:mappin];
location.latitude=(double)12.9752297537231;
location.longitude=(double)80.2313079833984;
mappin.coordinate=location;
mappin.title=[name objectAtIndex:1];
[self.annotation addObject:mappin];
location.latitude=(double)12.9788103103638;
location.longitude=(double)80.2412414550781;
mappin.title=[name objectAtIndex:2];
[self.annotation addObject:mappin];
[self.mapView addAnnotations:self.annotation];
self.mapView.mapType = MKMapTypeStandard;
self.mapView.showsUserLocation = YES;
}
Run Code Online (Sandbox Code Playgroud)
但它没有在MKMapViewController中显示任何注释请给我解决方案.
我是iOS新手.我在我的标签栏控制器故事板中使用了七个标签栏项目,当运行应用程序时,它会显示更多按钮,当我点击它时它也是显示编辑按钮.我不想要那个编辑按钮.如何才能做到这一点?
这是我的代码:
[[[tabBarController moreNavigationController] visibleViewController] setTitle:@""];
但它不起作用.