So My app was rejected (it has been approved every other time i have put it in for review and I hadn't touched this code path in ages)
so It got rejected for this line
Apparently addTextFieldWithValue:nil label:
is a private API...
so HOW THE HELL are we suppose to put a UITextField inside an AlertView?!
Can someone help?
Thank you
-K
__________________
-------------------------------------------------------------- Applications: Tap Dat! - Become a Tapping Fiend and compete with people around the world! www.batlin-solutions.com
So My app was rejected (it has been approved every other time i have put it in for review and I hadn't touched this code path in ages)
so It got rejected for this line
Apparently addTextFieldWithValue:nil label:
is a private API...
so HOW THE HELL are we suppose to put a UITextField inside an AlertView?!
Can someone help?
Thank you
-K
How were they able to tell that your code used a private API? You can do that with only public APIs, so how would they know that your app is not using those? Are they tearing apart our submitted apps' binaries, looking for such things?
Here's how you can do that with public apis:
Code:
UIAlertView *myAlertView = [[UIAlertView alloc] initWithTitle:@"Enter your zip code:" message:@"this gets covered by text field" delegate:self cancelButtonTitle:@"Cancel" otherButtonTitles:@"Search", nil];
UITextField *myTextField = [[UITextField alloc] init];
//[myTextField setBackgroundColor:[UIColor whiteColor]];
myTextField.delegate = self;
myTextField.opaque = YES;
myTextField.borderStyle = UITextBorderStyleRoundedRect;
myTextField.frame = CGRectMake(100, 45, 80, 25.0); //make this bigger if need be. I needed it small
myTextField.textAlignment = UITextAlignmentCenter;
myTextField.keyboardType = UIKeyboardTypeNumberPad; //change keyboard type, too
myTextField.returnKeyType = UIReturnKeyDone;
[myTextField becomeFirstResponder];
[myAlertView addSubview:myTextField];
[myTextField release];
CGAffineTransform myTransform = CGAffineTransformMakeTranslation(0.0, 130.0);
[myAlertView setTransform:myTransform];
[myAlertView show];
[myAlertView release];
How were they able to tell that your code used a private API? You can do that with only public APIs, so how would they know that your app is not using those? Are they tearing apart our submitted apps' binaries, looking for such things?
Undocumented APIs throw warnings dont they??? or atleast the ones ive used have.
Apple decompiles the binary you send them so they can see your code... sometimes this stuff must just slip through
They must of just started scanning, because up until this point I've
had no problems. This morning I received this:
...Unfortunately it cannot be added to the App Store because it is using private APIs. Use of non-public APIs, which as outlined in the iPhone Developer Program License Agreement section 3.3.1 is prohibited:
"3.3.1 Applications may only use Documented APIs in the manner prescribed by Apple and must not use or call any private APIs."
The following non-public APIs are included in your application:
addTextFieldWithValue:label:
textFieldAtIndex:
If they are taking the time to sniff through each line of code maybe that's why they take so long to approve apps?
Thanks all for the replies,
I have already tried the addSubView.. and it doesnt exactly do what I like..
what it does is it shows the Title of the AlertView but the body of the alert view gets covered up by the UITextField? I have tried to modify the frame of the AlertView with no luck...
I don't know how to attach pictures here but If I could it would show how on the way I did it (private way) it showed a Title, Message AND a textfield but with the add subview it only shows the title and textfield.. make sense?
Thank you all!
-K
__________________
-------------------------------------------------------------- Applications: Tap Dat! - Become a Tapping Fiend and compete with people around the world! www.batlin-solutions.com
If they are taking the time to sniff through each line of code maybe that's why they take so long to approve apps?
They don't need to sniff through every line of code. I don't think that they can access your source.
What they can see is what parts of the iPhone API are invoked. You can easily get this information with Instruments for example or any debugger.
__________________
-------------------------------------------------------------- Applications: Tap Dat! - Become a Tapping Fiend and compete with people around the world! www.batlin-solutions.com
Undocumented APIs throw warnings dont they??? or atleast the ones ive used have.
They do throw warnings, but that's just because the compiler doesn't know the method exists. All you have to do is define the methods in a header file, and the warnings will go away.
They do throw warnings, but that's just because the compiler doesn't know the method exists. All you have to do is define the methods in a header file, and the warnings will go away.
how does apple know you used this function instead of anotheir ?
I don't know the apple/iphone linkage or dynamic library so my opinion is based on experience of other system : if I have to test an application which I only have the binary, and this application is using dynamic library; I add a special mode or a proxy for those library to know which library is used and in librabry which function is used
I would not be surprised that apple have, for every function in library, a call to a generic trace function while entering and quitting every function (*). Then the amount of work to check if you are using some undocumented function is 'nil'
I don't know if I made it clear to understand
greg
(*) sound to be a lot of work, but when you debug a huge project, using many people work, it's a great help to read this trace (indented...) to find which function has been called before.
It should be pretty easy to spot private API usage (assuming they test every part of your application). In the end its their implementation, you can't use it undetected.
They could have a #define PRIVATE_API_SEARCH and each method will have a #ifdef PRIVATE_API_SEARCH NSLog(@"PRIVATE API USAGE DETECTED <<<<<");
Well chalk me up as rejected for the same. So stupid, I completely forgot about that line. Thanks for the example code guys.
Looks like they are getting a little more stingy on the private APIs what use to get though doesn't now
__________________
-------------------------------------------------------------- Applications: Tap Dat! - Become a Tapping Fiend and compete with people around the world! www.batlin-solutions.com
Sorry for the old bump, but I registered just to say thank you for this snippet. Got the same rejection from Apple and this made it easy for me to fix.
Looking around, this looks like a great community. I'll be sticking around
How were they able to tell that your code used a private API? You can do that with only public APIs, so how would they know that your app is not using those? Are they tearing apart our submitted apps' binaries, looking for such things?
App Store reviewers run every app through static code analysis tools during review as of a couple of months ago. The problem is they really don't know what they're doing with them.
There was one guy who's app got rejected for using a private API, which he contested. Turned out it was one Apple's own classes calling the private API.
How were they able to tell that your code used a private API? You can do that with only public APIs, so how would they know that your app is not using those? Are they tearing apart our submitted apps' binaries, looking for such things?
Here's how you can do that with public apis:
Code:
UIAlertView *myAlertView = [[UIAlertView alloc] initWithTitle:@"Enter your zip code:" message:@"this gets covered by text field" delegate:self cancelButtonTitle:@"Cancel" otherButtonTitles:@"Search", nil];
UITextField *myTextField = [[UITextField alloc] init];
//[myTextField setBackgroundColor:[UIColor whiteColor]];
myTextField.delegate = self;
myTextField.opaque = YES;
myTextField.borderStyle = UITextBorderStyleRoundedRect;
myTextField.frame = CGRectMake(100, 45, 80, 25.0); //make this bigger if need be. I needed it small
myTextField.textAlignment = UITextAlignmentCenter;
myTextField.keyboardType = UIKeyboardTypeNumberPad; //change keyboard type, too
myTextField.returnKeyType = UIReturnKeyDone;
[myTextField becomeFirstResponder];
[myAlertView addSubview:myTextField];
[myTextField release];
CGAffineTransform myTransform = CGAffineTransformMakeTranslation(0.0, 130.0);
[myAlertView setTransform:myTransform];
[myAlertView show];
[myAlertView release];
Where have you been for the last month. Yes, they are analysing the binaries we submit for private APIs, not something that is particularly complicated to do.
sorry for pushing this thread. I have the same problem and already solved it with your solution.
Just one more thing: It's necessary that the entered text get's shown in an UILabel. Do you know how I can do this?