Adding an Image to a UIActionSheet UIButton and App Approval

I want to send an iPhone application, and I am concerned about the following line of code that adds an image to the UIActionSheet button:

UIActionSheet *actionSheet = [[UIActionSheet alloc] initWithTitle:@""
                                                         delegate:self
                                                cancelButtonTitle:nil
                                           destructiveButtonTitle:nil
                                                otherButtonTitles:nil];
[actionSheet addButtonWithTitle:@"Button"];

[[[action valueForKey:@"_buttons"] objectAtIndex:0] setImage:[UIImage imageNamed:@"yourImage.png"] forState:UIControlStateNormal];

Does it compromise any of Apple's sumbition rules? it is legal? please tell me if.

Thank.

+3
source share
1 answer

This is not legal as _buttonsit is not a public API.

(I would say, however, that it will be tested by Apple since you are using KVC and they have no way of knowing that this is a private call. However, play it safe and do not use it!)

+1
source

All Articles