Will it crack an apple in a rage? (Will my application be rejected?)

I took this code from

Changing background color in 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]]; 

originally sent by oxygen.

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

+4
source share
3 answers

The underscores as prefixes of the properties you are accessing (_titleLabel, _bodyTextLabel) clearly indicate that they are private and should not be processed. Recently, Apple began to scan all the provided binaries to access private methods and properties, and these values ​​alone in your application should be sufficient to be rejected. It is never recommended to use private APIs, failures or not, because they are usually confidential for any reason and may break your application with future OS updates.

In addition, you violate the iPhone User Guide by changing the color of the alerts:

You can specify the text, the number of buttons, and the contents of the button in the warning, but you cannot configure the background view of the warning on its own.

Again, from the iPhone Human Interface Guide :

Since users are accustomed to the appearance and behavior of these views, it is important for them to use them consistently and correctly in the application.

+10
source

Only Apple can answer this question. And they will not answer it until you present it, and wait about 2 weeks.

If you really want it and you have 2 weeks to kill, try sending it. But later it may be rejected during the upgrade.

Are you using any undocumented APIs? If so, assume it will be rejected. If you are not, but you are doing something else, then the correct answer to your question is correct: "I do not know."

+2
source

If you want to know if any programming method will fail, make a small application with limited functionality and use dubious technique in it.

It takes 2 weeks to get an answer, but at least you will not invest a ton of time.

If they approve of your test application, remove it from the store. If he has a genuine utility, set the price to $ 0.99 and leave it alone.

This method is not reliable, but it is low cost.

0
source

All Articles