我为iTunesConnect发布了两次应用程序,并因崩溃而两次拒绝。
当用户点击" Contact" iPhone / iPad iOS 8.2上的标签,但我在模拟器或真实设备上进行了测试,但我无法发生这种崩溃......
你能告诉我一些事情吗?
以下是crash log
符号:
Exception Type: EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Triggered by Thread: 0
Last Exception Backtrace:
0 CoreFoundation 0x18237c2d8 0x182254000 + 1213144
1 libobjc.A.dylib 0x193a9c0e4 0x193a94000 + 32996
2 CoreFoundation 0x1823833a4 0x182254000 + 1242020
3 CoreFoundation 0x182380154 0x182254000 + 1229140
4 CoreFoundation 0x182282ccc 0x182254000 + 191692
5 BundoranSurfCo 0x1000190a4 -[Contact viewDidLoad] (Contact.m:20)
6 UIKit 0x186dbcc84 0x186dac000 + 68740
7 UIKit 0x186dbc994 0x186dac000 + 67988
8 UIKit 0x186ef2e68 0x186dac000 + 1338984
9 UIKit 0x186ef2b58 0x186dac000 + 1338200
10 UIKit 0x186fba378 0x186dac000 + 2155384
11 UIKit 0x186df1404 0x186dac000 + 283652
12 UIKit 0x186fba1cc 0x186dac000 + 2154956
13 UIKit 0x186df1404 0x186dac000 + 283652
14 UIKit 0x186dda4e0 0x186dac000 + 189664
15 UIKit 0x186fb9e04 0x186dac000 + 2153988
16 UIKit 0x186df1404 0x186dac000 + 283652
17 UIKit 0x186dda4e0 0x186dac000 + 189664
18 UIKit 0x186df0da0 0x186dac000 + 282016
19 UIKit 0x186daffc0 0x186dac000 + 16320
20 CoreFoundation 0x1823342a4 0x182254000 + 918180
21 CoreFoundation 0x182331230 0x182254000 + 905776
22 CoreFoundation 0x182331610 0x182254000 + 906768
23 CoreFoundation 0x18225d2d4 0x182254000 + 37588
24 GraphicsServices 0x18b94b6fc 0x18b940000 + 46844
25 UIKit 0x186e22fac 0x186dac000 + 487340
26 BundoranSurfCo 0x10001f4c4 main (main.m:14)
27 libdyld.dylib 0x19411aa08 0x194118000 + 10760
这里是Contact.m
的代码:
第20行是:self.fbLikeButton.likeControlStyle = FBLikeControlStyleBoxCount;
#import "Contact.h"
@interface Contact ()
@end
@implementation Contact
- (void)viewDidLoad {
[super viewDidLoad];
self.fbLikeButton.likeControlStyle = FBLikeControlStyleBoxCount;
self.fbLikeButton.objectID=@"https://www.facebook.com/BundoranSurfco/";
#pragma mark - Google Map API
GMSCameraPosition *camera = [GMSCameraPosition cameraWithLatitude: 54.481151
longitude: -8.272278 zoom: 15];
[self.mapView animateToCameraPosition:camera];
GMSMarker *marker = [ [GMSMarker alloc] init];
marker.position = camera.target;
marker.title = @"Bundoran Surf Co";
marker.snippet = @"Main Street";
marker.map = self.mapView;
}
- (void)viewWillDisappear:(BOOL)animated{
[super viewWillDisappear:animated] ;
self.mapView = nil ;
}
- (IBAction)openMail:(id)sender
{
if ([MFMailComposeViewController canSendMail])
{
MFMailComposeViewController *mailer = [[MFMailComposeViewController alloc] init];
mailer.mailComposeDelegate = self;
[mailer setSubject:@"Contact by BundoranSurfCo App"];
NSArray *toRecipients = [NSArray arrayWithObjects:@"info@bundoransurfco.com", nil];
[mailer setToRecipients:toRecipients];
UIImage *myImage = [UIImage imageNamed:@"logo.png"];
NSData *imageData = UIImagePNGRepresentation(myImage);
[mailer addAttachmentData:imageData mimeType:@"image/png" fileName:@"logo"];
NSString *emailBody = @"";
[mailer setMessageBody:emailBody isHTML:NO];
[self presentViewController:mailer animated:YES completion:nil];
}
else
{
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Failure"
message:@"Your device doesn't support the composer sheet"
delegate:nil
cancelButtonTitle:@"OK"
otherButtonTitles: nil];
[alert show];
}
}
- (void)mailComposeController:(MFMailComposeViewController*)controller didFinishWithResult:(MFMailComposeResult)result error:(NSError*)error
{
switch (result)
{
case MFMailComposeResultCancelled:
break;
case MFMailComposeResultSaved:
break;
case MFMailComposeResultSent:
break;
case MFMailComposeResultFailed:
break;
default:
break;
}
// Remove the mail view
[self dismissViewControllerAnimated:YES completion:nil];
}
- (IBAction)phoneButton:(id)sender {
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"tel:071-9841968"]];
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
@end
答案 0 :(得分:1)
崩溃报告说问题出在第20行(fbLikeButton
),我现在知道原因:
« FBLikeControl is a preview feature and may not be deployed to the App Store. Only developers and testers of your Facebook app will be able to use the Like Button. »
因此App崩溃并被Apple拒绝。