问题
So I have been developing an app that loads all content through a uiwebview and uses a tab bar and navigation bar for the user to traverse the app. Recently I submitted the app to the app store, and it was rejected with the following information.
"3.2 Apps with placeholder text will be rejected
We found that your app and/or its metadata does not appear to include final content, which is not in compliance with the App Store Review Guidelines.
Specifically, your app contains no content and has no apparent way to log in.
Please see the attached screenshot for more information."

From the image, it appears that the web view never came close to rendering (the bottom tab bar is always that dark grey color before the content loads). Every image provided was like this. When I inquired further, they assured me they were testing the app both with an internet connection as well as with cellular data.
I have the app installed on my device and a friends without changing any objective c code and it runs fine. I have several users on the android side of things so there is plenty of content on the app, provided the web view loads.
The web view is loaded in the viewDidLoad(){} method. I'm at a loss as to what to change, so if anyone has any advice I would be all ears. Do I need to programmatically check for a web view not rendering? If so, how would I go about this?
- (void)viewDidLoad
{
webView = [[UIWebView alloc] initWithFrame:CGRectMake(0, 0, self.view.frame.size.width,self.view.frame.size.height)];
[self.view addSubview:webView];
webView.scalesPageToFit = true;
NSURL *url = [NSURL URLWithString:@"http://example.com/finnaRoot/index.php"];
NSURLRequest *requestURL = [NSURLRequest requestWithURL:url];
[webView loadRequest:requestURL];
webView.scrollView.showsVerticalScrollIndicator = false;
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
webView.delegate = self;
self.tabBarController.delegate = self;
self.webView.scrollView.delegate = self;
}
my .h file has:
#import <UIKit/UIKit.h>
@interface FirstViewController : UIViewController <UITabBarControllerDelegate, UIScrollViewDelegate, UIWebViewDelegate>
@property (nonatomic, strong) IBOutlet UIWebView *webView;
@end
and my .m begins with
@synthesize webView;
回答1:
This is a gamble since you didn't include the information in the edit, but:
Your webview
variable may be declared as weak. Weak variables will be nilled out if nothing else has a strong reference to them. In the code shown above, nothing else has a strong reference to the web view until it is added as a subview.
There is a subtle difference between release and debug builds as to when this nilling out actually happens. It's a lot quicker in release builds.
What could be happening is that in the App Store build, the web view is destroyed immediately and you never even add it to the view, so no content is shown.
If you want to keep it as a weak ivar, create a local variable first with the web view and only assign it to the ivar once you have added it as a subview.
But the main lesson is always, always perform UAT using release builds. Don't just build and run with the device connected.
来源:https://stackoverflow.com/questions/27082101/uiwebview-never-rendered-and-app-rejected