Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Will this hack make apple furious? (Will the reject my app ?)

I have taken this code from

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]];

orginally posted by oxigen.

I am not very sure should I use this code in my app. Will apple have any issues regarding this hack (will they reject the app?)

like image 318
Madhup Singh Yadav Avatar asked Dec 17 '22 04:12

Madhup Singh Yadav


2 Answers

The underscores as prefixes of the properties you're accessing (_titleLabel, _bodyTextLabel) clearly indicate that these are private properties and should not be tinkered with. Apple has recently started scanning all submitted binaries for access to private methods and properties, and those values by themselves within your application should be enough to get you rejected. It is never a good idea to use private APIs, rejections or no, because they are typically private for a reason and may break your application with future OS updates.

Additionally, you are violating the iPhone Human Interface Guidelines by changing the alert color:

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.

Again, from the 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.

like image 155
Brad Larson Avatar answered Dec 30 '22 11:12

Brad Larson


Only Apple can answer that question. And they won't answer it until you submit it and wait approximately 2 weeks.

If you really want it in and have 2 weeks to kill, try to submit it. But it might get rejected at an update later.

Are you using any undocumented APIs here? If you are, assume it will get rejected. If you aren't but you are doing something different, then the only answer to your question which is correct is "I don't know".

like image 26
marcc Avatar answered Dec 30 '22 09:12

marcc