gpt4 book ai didi

iphone - 这次黑客攻击会让苹果愤怒吗? (会拒绝我的应用程序吗?)

转载 作者:行者123 更新时间:2023-12-03 19:05:11 25 4
gpt4 key购买 nike

我从这里获取了此代码

Changing the background color of a UIAlertView?

UIAlertView *theAlert = [[[UIAlertView alloc] initWithTitle:@"Atention"
message: @"YOUR MESSAGE HERE", nil)
delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil] autorelease];

[theAlert show];

UILabel *theTitle = [theAlert valueForKey:@"_titleLabel"];
[theTitle setTextColor:[UIColor redColor]];

UILabel *theBody = [theAlert valueForKey:@"_bodyTextLabel"];
[theBody setTextColor:[UIColor blueColor]];

UIImage *theImage = [UIImage imageNamed:@"Background.png"];
theImage = [theImage stretchableImageWithLeftCapWidth:16 topCapHeight:16];
CGSize theSize = [theAlert frame].size;

UIGraphicsBeginImageContext(theSize);
[theImage drawInRect:CGRectMake(0, 0, theSize.width, theSize.height)];
theImage = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();

[[theAlert layer] setContents:[theImage CGImage]];

最初由 oxigen 发布。

我不太确定是否应该在我的应用程序中使用此代码。苹果会对这次黑客攻击有任何问题吗(他们会拒绝该应用程序吗?)

最佳答案

下划线作为您正在访问的属性的前缀(_titleLabel、_bodyTextLabel)清楚地表明这些是私有(private)属性,不应修改。 Apple 最近开始扫描所有提交的二进制文件以访问私有(private)方法和属性,并且应用程序中的这些值本身应该足以让您被拒绝。无论是否拒绝,使用私有(private) API 都不是一个好主意,因为它们通常是私有(private)的,并且可能会在未来的操作系统更新中破坏您的应用程序。

此外,您还违反了iPhone Human Interface Guidelines通过更改警报颜色:

You can specify the text, the number of buttons, and the button contents in an alert, but you can’t customize the background appearance of the alert itself.

再次,来自 iPhone Human Interface Guidelines :

Because users are accustomed to the appearance and behavior of these views, it’s important to use them consistently and correctly in your application.

关于iphone - 这次黑客攻击会让苹果愤怒吗? (会拒绝我的应用程序吗?),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1761288/

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