gpt4 book ai didi

ios - 向 UIActivityViewController 添加一个整数?

转载 作者:行者123 更新时间:2023-11-28 22:15:17 25 4
gpt4 key购买 nike

我想向 UIActivityViewController 添加一个整数,但它不起作用。这是我的代码:

- (IBAction)socialButton:(id)sender {
NSString *shareText = @"I just scored %i in Helicave!", scoreNumber;
NSArray *itemsToShare = @[shareText];
UIActivityViewController *activityVC = [[UIActivityViewController alloc] initWithActivityItems:itemsToShare applicationActivities:nil];
activityVC.excludedActivityTypes = @[UIActivityTypePostToFlickr, UIActivityTypePostToTencentWeibo, UIActivityTypePostToWeibo, UIActivityTypePostToVimeo];
[self presentViewController:activityVC animated:YES completion:nil];
}

最佳答案

这一行:

NSString *shareText = @"I just scored %i in Helicave!", scoreNumber;

需要:

NSString *shareText = [NSString stringWithFormat:@"I just scored %i in Helicave!", scoreNumber];

关于ios - 向 UIActivityViewController 添加一个整数?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21868817/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com