崩溃应用程序

Posted

技术标签:

【中文标题】崩溃应用程序【英文标题】:Crashing Application 【发布时间】:2013-12-04 14:21:52 【问题描述】:

我有 2 个视图控制器。一个包含我从中向服务器发送请求的按钮,在另一个视图控制器中,我在 tableview 中显示数据。现在我的应用程序在执行 tableview 方法时有时会崩溃。我在 CFRetain 方法上崩溃了这是我的日志。

这是我的tableview代码:

#import "SearchResultViewController.h"
#import "UIImageView+AFNetworking.h"
#import "SearchResultCell.h"

@interface SearchResultViewController ()

@end

@implementation SearchResultViewController

- (id)initWithStyle:(UITableViewStyle)style 
self = [super initWithStyle:style];
if (self) 
    // Custom initialization

return self;


 - (void)viewDidLoad 
[super viewDidLoad];
UIBarButtonItem *btnHelp = [[UIBarButtonItem alloc] initWithTitle:@"Help" style:UIBarButtonItemStylePlain target:self action:@selector(btnHelpAction:)];
self.navigationItem.rightBarButtonItem=btnHelp;
self.title = @"Search Result";



-(IBAction)btnHelpAction:(id)sender
HelpViewController *HVC=[[HelpViewController alloc]init];
UINavigationController *helpNavController=[[UINavigationController alloc]initWithRootViewController:HVC];
[self presentViewController:helpNavController animated:YES completion:nil];

- (void)setTitle:(NSString *)title 
//    [super setTitle:title];
UILabel *titleView = (UILabel *)self.navigationItem.titleView;
if (!titleView) 
    titleView = [[UILabel alloc] initWithFrame:CGRectZero];
    titleView.backgroundColor = [UIColor clearColor];
    titleView.font = [UIFont fontWithName:GZFont size:16.0];
    titleView.textColor = [UIColor colorWithRed:241/255.0 green:90/255.0 blue:41/255.0 alpha:1.0];
    self.navigationItem.titleView = titleView;

titleView.text = title;
[titleView sizeToFit];
  


  - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView 
return [MyAppDelegate.searchResultArray count];
 // return 1;
 
 - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section 
return 1;    //changes
 
- (CGFloat) tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath 
return 100;
    
    - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath 

SearchResultCell *cell = [tableView dequeueReusableCellWithIdentifier:@"SearchResultCell"];
NSArray *tempSearchArray=[MyAppDelegate.searchResultArray objectAtIndex:indexPath.section];
if (cell == nil) 
    NSArray *topLevelObject;
    topLevelObject = [[NSBundle mainBundle] loadNibNamed:@"SearchResultCell" owner:self options:nil];
    cell = [topLevelObject objectAtIndex:0];

NSLog(@"%@",[tempSearchArray objectAtIndex:0]);
cell.lblUsername.text = [tempSearchArray objectAtIndex:0];
cell.lblNumber.text = [NSString stringWithFormat:@"%@",[tempSearchArray objectAtIndex:1]];
if([tempSearchArray objectAtIndex:2]==[NSNull null])

    NSLog(@"nullll");
    cell.lblFirst_name.text=@"";

else
    cell.lblFirst_name.text = [tempSearchArray objectAtIndex:2];

cell.lblLast_name.text = [tempSearchArray objectAtIndex:3];

cell.lblEstablishment.text = @"E1123522";

if ([[[NSUserDefaults standardUserDefaults] valueForKey:@"UserLogedInType"] intValue] == LoginTypeFacebook) 
    if ([[NSUserDefaults standardUserDefaults] objectForKey:@"FBUserLogedInProfileData"] != [NSNull null]) 
        NSMutableDictionary *FBUserProfileData = [[NSMutableDictionary alloc] initWithDictionary:[[NSUserDefaults standardUserDefaults] objectForKey:@"FBUserLogedInProfileData"]];
        [cell.imgIcon setImageWithURL:[NSURL URLWithString:[NSString stringWithFormat:@"https://graph.facebook.com/%@/picture?width=100&height=100",[FBUserProfileData objectForKey:@"id"]]]
                   placeholderImage:[UIImage imageNamed:@"icon.png"]];
    

else 
    if([[tempSearchArray objectAtIndex:6] boolValue]==1)
        ASIFormDataRequest *_requestImage = [[ASIFormDataRequest alloc] initWithURL:[NSURL URLWithString:URLGetImage]];
        __unsafe_unretained ASIFormDataRequest *requestImage = _requestImage;
        [requestImage setPostValue:[tempSearchArray objectAtIndex:4] forKey:@"user_id"];
        [requestImage startAsynchronous];
        [requestImage setCompletionBlock:^
            NSLog(@"proimage%@",[requestImage responseData]);
            cell.imgIcon.image=[UIImage imageWithData:[requestImage responseData] scale:1.0f];
        ];
    
    else
    [cell.imgIcon setImage:[UIImage imageNamed:@"No_image.png"]];
    


cell.imgIcon.layer.cornerRadius = 3.0;
cell.imgIcon.layer.masksToBounds = YES;


DYRateView *rateView = [[DYRateView alloc] initWithFrame:CGRectMake(90, 75, 120, 20)
                                    fullStar:[UIImage imageNamed:@"StarFullLarge.png"]
                                   emptyStar:[UIImage imageNamed:@"StarEmptyLarge.png"]];
rateView.padding = 2;
rateView.rate =[[tempSearchArray objectAtIndex:5] floatValue];
//NSLog(@"rating value%f",[[tempSearchArray objectAtIndex:4] floatValue]);
rateView.alignment = RateViewAlignmentCenter;
rateView.editable = YES;
rateView.delegate = self;
rateView.editable = NO;
[cell addSubview:rateView];

return cell;


 - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
SearchedProfileViewController *profileVC=[[SearchedProfileViewController alloc]init];
profileVC.cellId=indexPath.section;
NSLog(@"%d",profileVC.cellId);
[self.navigationController pushViewController:profileVC animated:YES];
//[self presentViewController:profileVC animated:YES completion:nil];


 - (void)rateView:(DYRateView *)rateView changedToNewRate:(NSNumber *)rate 
//    self.rateLabel.text = [NSString stringWithFormat:@"Rate: %d", rate.intValue];
 

 - (void)didReceiveMemoryWarning 
[super didReceiveMemoryWarning];


@end

更新的崩溃日志:

Objective: objective 0xda869f0: <1:568> + <1:0.5>*0xd982420.markerid: 726 + <1:-0.5>*_UIParallaxDimmingView:0x1186bb10.Heightid: 707
  2013-12-05 14:41:01.318 GratZeez[1567:3503] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: '<NSISEngine: 0xc67f090> Rows:
0xc67fa30.negErrorid: 631 == 6 + -1*0xc67d5e0:IB auto generated at build time for view with fixed frame.markerid: 495 + 1*0xc67fa30.posErrorMarkerid: 630
0xc685ce0.posErrorMarkerid: 644 == 132 + 1*0xc68b900:IB auto generated at build time for view with fixed frame.markerid: 509 + 1*0xc685ce0.negErrorid: 645
0xc6888b0.posErrorMarkerid: 658 == 106 + 1*0xc68b9c0:IB auto generated at build time for view with fixed frame.markerid: 517 + 1*0xc6888b0.negErrorid: 659
0xc6888f0.posErrorMarkerid: 660 == 0 + 1*0xc67b5d0:IB auto generated at build time for view with fixed frame.markerid: 519 + 1*0xc6888f0.negErrorid: 661
0xc69ffd0.posErrorMarkerid: 646 == 0 + 1*0xc68b930:IB auto generated at build time for view with fixed frame.markerid: 511 + 1*0xc69ffd0.negErrorid: 647
0xc6b3200.posErrorMarkerid: 628 == 90 + 1*0xc67ace0:IB auto generated at build time for view with fixed frame.markerid: 493 + 1*0xc6b3200.negErrorid: 629
0xc6b45d0.posErrorMarkerid: 636 == 114 + 1*0xc67d670:IB auto generated at build time for view with fixed frame.markerid: 501 + 1*0xc6b45d0.negErrorid: 637
0xc6b4620.posErrorMarkerid: 638 == 0 + 1*0xc67d6a0:IB auto generated at build time for view with fixed frame.markerid: 503 + 1*0xc6b4620.negErrorid: 639
0xc6b4dc0.posErrorMarkerid: 664 == 72 + 1*0xc67b660:IB auto generated at build time for view with fixed frame.markerid: 525 + 1*0xc6b4dc0.negErrorid: 665
0xc6b4e00.posErrorMarkerid: 667 == 0 + 1*0xc67b690:IB auto generated at build time for view with fixed frame.markerid: 527 + 1*0xc6b4e00.negErrorid: 668
0xd9707e0.posErrorMarkerid: 589 == 128 + 1*0xc6b34d0:IB auto generated at build time for view with fixed frame.markerid: 553 + 1*0xd9707e0.negErrorid: 590
0xd970820.posErrorMarkerid: 591 == 0 + 1*0xc6b3500:IB auto generated at build time for view with fixed frame.markerid: 555 + 1*0xd970820.negErrorid: 592
0xd974070.posErrorMarkerid: 585 == 104 + 1*0xc6b3410:IB auto generated at build time for view with fixed frame.markerid: 545 + 1*0xd974070.negErrorid: 586
0xd977ca0.posErrorMarkerid: 632 == 90 + 1*0xc6b3650:IB auto generated at build time for view with fixed frame.markerid: 569 + 1*0xd977ca0.negErrorid: 633
0xd977dd0.posErrorMarkerid: 634 == 0 + 1*0xc6b3680:IB auto generated at build time for view with fixed frame.markerid: 571 + 1*0xd977dd0.negErrorid: 635
0xd97a6d0.negErrorid: 588 == 6 + -1*0xc6b3440:IB auto generated at build time for view with fixed frame.markerid: 547 + 1*0xd97a6d0.posErrorMarkerid: 587
0xd97ac70.posErrorMarkerid: 640 == 72 + 1*0xc6b3710:IB auto generated at build time for view with fixed frame.markerid: 577 + 1*0xd97ac70.negErrorid: 641
0xd97acd0.posErrorMarkerid: 642 == 0 + 1*0xc6b3740:IB auto generated at build time for view with fixed frame.markerid: 579 + 1*0xd97acd0.negErrorid: 643
0xd97cfb0.posErrorMarkerid: 601 == 200 + 1*0xc6b3590:IB auto generated at build time for view with fixed frame.markerid: 561 + 1*0xd97cfb0.negErrorid: 602
0xd97cff0.posErrorMarkerid: 603 == 42 + 1*0xc6b35c0:IB auto generated at build time for view with fixed frame.markerid: 563 + 1*0xd97cff0.negErrorid: 604
SearchResultCell:0xc6ade20.Heightid: 652 == 200 + 1*0xd97b820.markerid: 655
SearchResultCell:0xc6ade20.Widthid: 650 == 640 + 2*0xd97b7c0.markerid: 653 + 1*0xd97bd90.markerid: 670
SearchResultCell:0xc6ade20.minXid: 649 == 0 + 2*0xd97b790.markerid: 648 + -1*0xd97b7c0.markerid: 653
SearchResultCell:0xc6ade20.minYid: 651 == 0 + 2*0xd97b7f0.markerid: 654 + -0.5*0xd97b820.markerid: 655
SearchResultCell:0xc6b2fd0.Heightid: 617 == 200 + 1*0xc6a6a20.markerid: 625
SearchResultCell:0xc6b2fd0.Widthid: 614 == 640 + 2*0xc672a00.markerid: 623 + 1*0xd97bd90.markerid: 670
SearchResultCell:0xc6b2fd0.minXid: 620 == 0 + 2*0xc6a03a0.markerid: 619 + -1*0xc672a00.markerid: 623
SearchResultCell:0xc6b2fd0.minYid: 621 == 200 + 2*0xc673060.markerid: 624 + -0.5*0xc6a6a20.markerid: 625
UIImageView:0xc67faa0.Heightid: 540 == 150 + 1*0xc6b3380:IB auto generated at build time for view with fixed frame.markerid: 539
UIImageView:0xc67faa0.Widthid: 538 == 150 + 1*0xc6b3350:IB auto generated at build time for view with fixed frame.markerid: 537
UIImageView:0xc67faa0.minXid: 534 == 20 + 1*0xc6b32a0:IB auto generated at build time for view with fixed frame.markerid: 533
UIImageView:0xc67faa0.minYid: 536 == 24 + 1*0xc6b3320:IB auto generated at build time for view with fixed frame.markerid: 535
UIImageView:0xc696c80.Heightid: 488 == 150 + 1*0xc67ac50:IB auto generated at build time for view with fixed frame.markerid: 487
UIImageView:0xc696c80.Widthid: 486 == 150 + 1*0xc67ac20:IB auto generated at build time for view with fixed frame.markerid: 485
UIImageView:0xc696c80.minXid: 482 == 20 + 1*0xc699a30:IB auto generated at build time for view with fixed frame.markerid: 481
UIImageView:0xc696c80.minYid: 484 == 24 + 1*0xc699ab0:IB auto generated at build time for view with fixed frame.markerid: 483
UILabel:0xc6732d0.Heightid: 548 == 42 + 1*0xc6b3440:IB auto generated at build time for view with fixed frame.markerid: 547
UILabel:0xc6732d0.Widthid: 546 == 434 + 1*0xc6b3410:IB auto generated at build time for view with fixed frame.markerid: 545
UILabel:0xc6732d0.minXid: 542 == 186 + 1*0xc6b33b0:IB auto generated at build time for view with fixed frame.markerid: 541
UILabel:0xc6732d0.minYid: 544 == 20 + 1*0xc6b33e0:IB auto generated at build time for view with fixed frame.markerid: 543
UILabel:0xc67bf90.Heightid: 564 == 42 + 1*0xc6b35c0:IB auto generated at build time for view with fixed frame.markerid: 563
UILabel:0xc67bf90.Widthid: 562 == 200 + 1*0xc6b3590:IB auto generated at build time for view with fixed frame.markerid: 561
UILabel:0xc67bf90.minXid: 558 == 420 + 1*0xc6b3530:IB auto generated at build time for view with fixed frame.markerid: 557
UILabel:0xc67bf90.minYid: 560 == 68 + 1*0xc6b3560:IB auto generated at build time for view with fixed frame.markerid: 559
UILabel:0xc67d490.Heightid: 572 == 42 + 1*0xc6b3680:IB auto generated at build time for view with fixed frame.markerid: 571
UILabel:0xc67d490.Widthid: 570 == 200 + 1*0xc6b3650:IB auto generated at build time for view with fixed frame.markerid: 569
UILabel:0xc67d490.minXid: 566 == 186 + 1*0xc6b35f0:IB auto generated at build time for view with fixed frame.markerid: 565
UILabel:0xc67d490.minYid: 568 == 106 + 1*0xc6b3620:IB auto generated at build time for view with fixed frame.markerid: 567
UILabel:0xc67d840.Heightid: 512 == 42 + 1*0xc68b930:IB auto generated at build time for view with fixed frame.markerid: 511
UILabel:0xc67d840.Widthid: 510 == 200 + 1*0xc68b900:IB auto generated at build time for view with fixed frame.markerid: 509
UILabel:0xc67d840.minXid: 506 == 420 + 1*0xc67d6d0:IB auto generated at build time for view with fixed frame.markerid: 505
UILabel:0xc67d840.minYid: 508 == 68 + 1*0xc68b8d0:IB auto generated at build time for view with fixed frame.markerid: 507
UILabel:0xc681210.Heightid: 504 == 42 + 1*0xc67d6a0:IB auto generated at build time for view with fixed frame.markerid: 503
UILabel:0xc681210.Widthid: 502 == 200 + 1*0xc67d670:IB auto generated at build time for view with fixed frame.markerid: 501
UILabel:0xc681210.minXid: 498 == 186 + 1*0xc67d610:IB auto generated at build time for view with fixed frame.markerid: 497
UILabel:0xc681210.minYid: 500 == 68 + 1*0xc67d640:IB auto generated at build time for view with fixed frame.markerid: 499
UILabel:0xc683e20.Heightid: 520 == 42 + 1*0xc67b5d0:IB auto generated at build time for view with fixed frame.markerid: 519
UILabel:0xc683e20.Widthid: 518 == 200 + 1*0xc68b9c0:IB auto generated at build time for view with fixed frame.markerid: 517
UILabel:0xc683e20.minXid: 514 == 186 + 1*0xc68b960:IB auto generated at build time for view with fixed frame.markerid: 513
UILabel:0xc683e20.minYid: 516 == 106 + 1*0xc68b990:IB auto generated at build time for view with fixed frame.markerid: 515
UILabel:0xc685a40.Heightid: 556 == 42 + 1*0xc6b3500:IB auto generated at build time for view with fixed frame.markerid: 555
UILabel:0xc685a40.Widthid: 554 == 200 + 1*0xc6b34d0:IB auto generated at build time for view with fixed frame.markerid: 553
UILabel:0xc685a40.minXid: 550 == 186 + 1*0xc6b3470:IB auto generated at build time for view with fixed frame.markerid: 549
UILabel:0xc685a40.minYid: 552 == 68 + 1*0xc6b34a0:IB auto generated at build time for view with fixed frame.markerid: 551
UILabel:0xc686460.Heightid: 580 == 42 + 1*0xc6b3740:IB auto generated at build time for view with fixed frame.markerid: 579
UILabel:0xc686460.Widthid: 578 == 200 + 1*0xc6b3710:IB auto generated at build time for view with fixed frame.markerid: 577
UILabel:0xc686460.minXid: 574 == 420 + 1*0xc6b36b0:IB auto generated at build time for view with fixed frame.markerid: 573
UILabel:0xc686460.minYid: 576 == 106 + 1*0xc6b36e0:IB auto generated at build time for view with fixed frame.markerid: 575
UILabel:0xc68a640.Heightid: 528 == 42 + 1*0xc67b690:IB auto generated at build time for view with fixed frame.markerid: 527
UILabel:0xc68a640.Widthid: 526 == 200 + 1*0xc67b660:IB auto generated at build time for view with fixed frame.markerid: 525
UILabel:0xc68a640.minXid: 522 == 420 + 1*0xc67b600:IB auto generated at build time for view with fixed frame.markerid: 521
UILabel:0xc68a640.minYid: 524 == 106 + 1*0xc67b630:IB auto generated at build time for view with fixed frame.markerid: 523
UILabel:0xc68c5d0.Heightid: 496 == 42 + 1*0xc67d5e0:IB auto generated at build time for view with fixed frame.markerid: 495
UILabel:0xc68c5d0.Widthid: 494 == 434 + 1*0xc67ace0:IB auto generated at build time for view with fixed frame.markerid: 493
UILabel:0xc68c5d0.minXid: 490 == 186 + 1*0xc67ac80:IB auto generated at build time for view with fixed frame.markerid: 489
UILabel:0xc68c5d0.minYid: 492 == 20 + 1*0xc67acb0:IB auto generated at build time for view with fixed frame.markerid: 491
UILayoutContainerView:0xc670770.Heightid: 393 == 1136 + 1*0xc685240:UIView-Encapsulated-Layout-Height.markerid: 398
UILayoutContainerView:0xc670770.Widthid: 390 == 640 + 1*0xc685210:UIView-Encapsulated-Layout-Width.markerid: 395
UINavigationTransitionView:0xc6720e0.Heightid: 389 == 1136 + 2*0xc6844d0.markerid: 394 + 1*0xc685240:UIView-Encapsulated-Layout-Height.markerid: 398
UINavigationTransitionView:0xc6720e0.Widthid: 387 == 640 + 2*0xc684430.markerid: 391 + 1*0xc685210:UIView-Encapsulated-Layout-Width.markerid: 395
UINavigationTransitionView:0xc6720e0.minXid: 386 == 0 + 2*0xc684400.markerid: 385 + -1*0xc684430.markerid: 391
UINavigationTransitionView:0xc6720e0.minYid: 388 == 0 + 2*0xc6844a0.markerid: 392 + -1*0xc6844d0.markerid: 394
UITableView:0x14a40a00.Heightid: 701 == 0 + 1*_UIParallaxDimmingView:0x1186bb10.Heightid: 707 + 2*0xd97c220.markerid: 710
UITableView:0x14a40a00.Widthid: 699 == 640 + 2*0xd97c1c0.markerid: 703 + 1*0xd9823c0.markerid: 719 + -2*tempToBeOptimizedToZeroid: 720
UITableView:0x14a40a00.contentHeightid: 480 == 400 + 1*0xc6ad9c0.markerid: 479
UITableView:0x14a40a00.contentWidthid: 478 == 640 + 1*0xc6ad980.markerid: 477
UITableView:0x14a40a00.minXid: 698 == 0 + 2*0xd97c190.markerid: 697 + -1*0xd97c1c0.markerid: 703
UITableView:0x14a40a00.minYid: 700 == 0 + 2*0xd97c1f0.markerid: 705 + -1*0xd97c220.markerid: 710
UITableViewCellContentView:0xc67b900.Heightid: 677 == 199 + 1*0xc6b51c0.markerid: 683
UITableViewCellContentView:0xc67b900.Widthid: 675 == 640 + 1*0xc6b5160.markerid: 678
UITableViewCellContentView:0xc67b900.minXid: 674 == 0 + 2*0xc6b5130.markerid: 673 + -0.5*0xc6b5160.markerid: 678
UITableViewCellContentView:0xc67b900.minYid: 676 == 0 + 2*0xc6b5190.markerid: 681 + -0.5*0xc6b51c0.markerid: 683
UITableViewCellContentView:0xc6a7d10.Heightid: 597 == 199 + 1*0xc6ae810.markerid: 606
UITableViewCellContentView:0xc6a7d10.Widthid: 595 == 640 + 1*0xc6ae700.markerid: 598
UITableViewCellContentView:0xc6a7d10.minXid: 594 == 0 + 2*0xc6ae660.markerid: 593 + -0.5*0xc6ae700.markerid: 598
UITableViewCellContentView:0xc6a7d10.minYid: 596 == 0 + 2*0xc6ae750.markerid: 605 + -0.5*0xc6ae810.markerid: 606
UITableViewCellScrollView:0xc6aeb60.Heightid: 693 == 200 + 1*0xd97b820.markerid: 655 + 2*0xc6b5c10.markerid: 706
UITableViewCellScrollView:0xc6aeb60.Widthid: 691 == 640 + 2*0xd97b7c0.markerid: 653 + 1*0xd97bd90.markerid: 670 + 2*0xc6b5bb0.markerid: 694
UITableViewCellScrollView:0xc6aeb60.contentHeightid: 532 == 200 + 1*0xc68c560.markerid: 531
UITableViewCellScrollView:0xc6aeb60.contentWidthid: 530 == 640 + 1*0xc68c4c0.markerid: 529
UITableViewCellScrollView:0xc6aeb60.minXid: 690 == 0 + 2*0xc6b5d00.markerid: 689 + -1*0xc6b5bb0.markerid: 694
UITableViewCellScrollView:0xc6aeb60.minYid: 692 == 0 + 2*0xc6b5be0.markerid: 704 + -1*0xc6b5c10.markerid: 706
UITableViewCellScrollView:0xc6b3880.Heightid: 613 == 200 + 2*0xc6b2480.markerid: 618 + 1*0xc6a6a20.markerid: 625
UITableViewCellScrollView:0xc6b3880.Widthid: 611 == 640 + 2*0xc6b22e0.markerid: 615 + 2*0xc672a00.markerid: 623 + 1*0xd97bd90.markerid: 670
UITableViewCellScrollView:0xc6b3880.contentHeightid: 584 == 200 + 1*0xc6b3ce0.markerid: 583
UITableViewCellScrollView:0xc6b3880.contentWidthid: 582 == 640 + 1*0xc6b37d0.markerid: 581
UITableViewCellScrollView:0xc6b3880.minXid: 610 == 0 + 2*0xc6b2220.markerid: 609 + -1*0xc6b22e0.markerid: 615
UITableViewCellScrollView:0xc6b3880.minYid: 612 == 0 + 2*0xc6b23b0.markerid: 616 + -1*0xc6b2480.markerid: 618
UITableViewWrapperView:0x1186b2c0.Heightid: 669 == 1136 + 1*0xd97bdf0.markerid: 686
UITableViewWrapperView:0x1186b2c0.Widthid: 622 == 640 + 1*0xd97bd90.markerid: 670
UITableViewWrapperView:0x1186b2c0.minXid: 663 == 0 + 2*0xd97bd60.markerid: 662 + -0.5*0xd97bd90.markerid: 670
UITableViewWrapperView:0x1186b2c0.minYid: 666 == 0 + 2*0xd97bdc0.markerid: 682 + -0.5*0xd97bdf0.markerid: 686
UIView:0xc674820.Heightid: 453 == 1136 + 1*0xc679f40.markerid: 474
UIView:0xc674820.Widthid: 451 == 640 + 1*0xc69ff70.markerid: 470
UIView:0xc674820.minXid: 450 == -192 + 2*0xc69ff40.markerid: 469 + -0.5*0xc69ff70.markerid: 470
UIView:0xc674820.minYid: 452 == 0 + 2*0xc69ffa0.markerid: 473 + -0.5*0xc679f40.markerid: 474
UIView:0xc6752d0.Heightid: 718 == 1136 + 1*0xd982620.markerid: 730
UIView:0xc6752d0.Widthid: 716 == 640 + 1*0xd9825c0.markerid: 722
UIView:0xc6752d0.minXid: 715 == 0 + 2*0xd982580.markerid: 714 + -0.5*0xd9825c0.markerid: 722
UIView:0xc6752d0.minYid: 717 == 0 + 2*0xd9825f0.markerid: 729 + -0.5*0xd982620.markerid: 730
UIViewControllerWrapperView:0xc687700.Heightid: 377 == 1136 + 1*0xc683fa0.markerid: 382
UIViewControllerWrapperView:0xc687700.Widthid: 375 == 640 + 1*0xc683f00.markerid: 378
UIViewControllerWrapperView:0xc687700.minXid: 374 == 0 + 2*0xc683ed0.markerid: 373 + -0.5*0xc683f00.markerid: 378
UIViewControllerWrapperView:0xc687700.minYid: 376 == 0 + 2*0xc683f70.markerid: 381 + -0.5*0xc683fa0.markerid: 382
_UIParallaxDimmingView:0x1186bb10.Widthid: 702 == 640 + 1*0xd9823c0.markerid: 719
_UIParallaxDimmingView:0x1186bb10.minXid: 712 == 0 + 2*0xd982390.markerid: 711 + -0.5*0xd9823c0.markerid: 719 + 1*tempToBeOptimizedToZeroid: 720
_UIParallaxDimmingView:0x1186bb10.minYid: 713 == 568 + -0.5*_UIParallaxDimmingView:0x1186bb10.Heightid: 707 + 2*0xd9823f0.markerid: 725
objectiveid: 243 == objective 0xc67e090: <750:12, 251:1150> + <251:1>*0xc67ace0:IB auto generated at build time for view with fixed frame.markerid: 493 + <251:1>*0xc67b5d0:IB auto generated at build time for view with fixed frame.markerid: 519 + <251:1>*0xc67b660:IB auto generated at build time for view with fixed frame.markerid: 525 + <251:1>*0xc67b690:IB auto generated at build time for view with fixed frame.markerid: 527 + <750:-1>*0xc67d5e0:IB auto generated at build time for view with fixed frame.markerid: 495 + <251:1>*0xc67d670:IB auto generated at build time for view with fixed frame.markerid: 501 + <251:1>*0xc67d6a0:IB auto generated at build time for view with fixed frame.markerid: 503 + <750:1, 251:1>*0xc67fa30.posErrorMarkerid: 630 + <750:1, 251:1>*0xc685ce0.negErrorid: 645 + <750:1, 251:1>*0xc6888b0.negErrorid: 659 + <750:1, 251:1>*0xc6888f0.negErrorid: 661 + <251:1>*0xc68b900:IB auto generated at build time for view with fixed frame.markerid: 509 + <251:1>*0xc68b930:IB auto generated at build time for view with fixed frame.markerid: 511 + <251:1>*0xc68b9c0:IB auto generated at build time for view with fixed frame.markerid: 517 + <750:1, 251:1>*0xc69ffd0.negErrorid: 647 + <750:1, 251:1>*0xc6b3200.negErrorid: 629 + <251:1>*0xc6b3410:IB auto generated at build time for view with fixed frame.markerid: 545 + <750:-1>*0xc6b3440:IB auto generated at build time for view with fixed frame.markerid: 547 + <251:1>*0xc6b34d0:IB auto generated at build time for view with fixed frame.markerid: 553 + <251:1>*0xc6b3500:IB auto generated at build time for view with fixed frame.markerid: 555 + <251:1>*0xc6b3590:IB auto generated at build time for view with fixed frame.markerid: 561 + <251:1>*0xc6b35c0:IB auto generated at build time for view with fixed frame.markerid: 563 + <251:1>*0xc6b3650:IB auto generated at build time for view with fixed frame.markerid: 569 + <251:1>*0xc6b3680:IB auto generated at build time for view with fixed frame.markerid: 571 + <251:1>*0xc6b3710:IB auto generated at build time for view with fixed frame.markerid: 577 + <251:1>*0xc6b3740:IB auto generated at build time for view with fixed frame.markerid: 579 + <750:1, 251:1>*0xc6b45d0.negErrorid: 637 + <750:1, 251:1>*0xc6b4620.negErrorid: 639 + <750:1, 251:1>*0xc6b4dc0.negErrorid: 665 + <750:1, 251:1>*0xc6b4e00.negErrorid: 668 + <750:1, 251:1>*0xd9707e0.negErrorid: 590 + <750:1, 251:1>*0xd970820.negErrorid: 592 + <750:1, 251:1>*0xd974070.negErrorid: 586 + <750:1, 251:1>*0xd977ca0.negErrorid: 633 + <750:1, 251:1>*0xd977dd0.negErrorid: 635 + <750:1, 251:1>*0xd97a6d0.posErrorMarkerid: 587 + <750:1, 251:1>*0xd97ac70.negErrorid: 641 + <750:1, 251:1>*0xd97acd0.negErrorid: 643 + <750:1, 251:1>*0xd97cfb0.negErrorid: 602 + <750:1, 251:1>*0xd97cff0.negErrorid: 604
tempToBeOptimizedToZeroObjectiveid: 728 == objective 0xda869f0: <1:568> + <1:0.5>*0xd982420.markerid: 726 + <1:-0.5>*_UIParallaxDimmingView:0x1186bb10.Heightid: 707
tempToBeOptimizedToZeroid: 727 == 568 + -0.5*_UIParallaxDimmingView:0x1186bb10.Heightid: 707 + 0.5*0xd982420.markerid: 726
     Constraints:
<NSAutoresizingMaskLayoutConstraint:0xc672a00 h=-&- v=--& SearchResultCell:0xc6b2fd0.width == UITableViewWrapperView:0x1186b2c0.width>      Marker:0xc672a00.markerid: 623
<NSAutoresizingMaskLayoutConstraint:0xc673060 h=-&- v=--& SearchResultCell:0xc6b2fd0.midY == + 150>     Marker:0xc673060.markerid: 624
<NSAutoresizingMaskLayoutConstraint:0xc679f40 h=--& v=--& V:[UIView:0xc674820(568)]>        Marker:0xc679f40.markerid: 474
<NSAutoresizingMaskLayoutConstraint:0xc683ed0 h=--& v=--& UIViewControllerWrapperView:0xc687700.midX == + 160>      Marker:0xc683ed0.markerid: 373
<NSAutoresizingMaskLayoutConstraint:0xc683f00 h=--& v=--& H:[UIViewControllerWrapperView:0xc687700(320)]>       Marker:0xc683f00.markerid: 378
<NSAutoresizingMaskLayoutConstraint:0xc683f70 h=--& v=--& UIViewControllerWrapperView:0xc687700.midY == + 284>      Marker:0xc683f70.markerid: 381
<NSAutoresizingMaskLayoutConstraint:0xc683fa0 h=--& v=--& V:[UIViewControllerWrapperView:0xc687700(568)]>       Marker:0xc683fa0.markerid: 382
<NSAutoresizingMaskLayoutConstraint:0xc684400 h=-&- v=-&- UINavigationTransitionView:0xc6720e0.midX == UILayoutContainerView:0xc670770.midX>        Marker:0xc684400.markerid: 385
<NSAutoresizingMaskLayoutConstraint:0xc684430 h=-&- v=-&- UINavigationTransitionView:0xc6720e0.width == UILayoutContainerView:0xc670770.width>      Marker:0xc684430.markerid: 391
<NSAutoresizingMaskLayoutConstraint:0xc6844a0 h=-&- v=-&- UINavigationTransitionView:0xc6720e0.midY == UILayoutContainerView:0xc670770.midY>        Marker:0xc6844a0.markerid: 392
<NSAutoresizingMaskLayoutConstraint:0xc6844d0 h=-&- v=-&- UINavigationTransitionView:0xc6720e0.height == UILayoutContainerView:0xc670770.height>        Marker:0xc6844d0.markerid: 394
<NSAutoresizingMaskLayoutConstraint:0xc69ff40 h=--& v=--& UIView:0xc674820.midX == + 64>        Marker:0xc69ff40.markerid: 469
<NSAutoresizingMaskLayoutConstraint:0xc69ff70 h=--& v=--& H:[UIView:0xc674820(320)]>        Marker:0xc69ff70.markerid: 470
<NSAutoresizingMaskLayoutConstraint:0xc69ffa0 h=--& v=--& UIView:0xc674820.midY == + 284>       Marker:0xc69ffa0.markerid: 473
<NSAutoresizingMaskLayoutConstraint:0xc6a03a0 h=-&- v=--& SearchResultCell:0xc6b2fd0.midX == UITableViewWrapperView:0x1186b2c0.midX>        Marker:0xc6a03a0.markerid: 619
<NSAutoresizingMaskLayoutConstraint:0xc6a6a20 h=-&- v=--& V:[SearchResultCell:0xc6b2fd0(100)]>      Marker:0xc6a6a20.markerid: 625
<NSAutoresizingMaskLayoutConstraint:0xc6ae660 h=--& v=--& UITableViewCellContentView:0xc6a7d10.midX == + 160>       Marker:0xc6ae660.markerid: 593

还有更多关于自动调整大小和内容大小的日志

【问题讨论】:

关于 NSAutoLayout 应该在另一个线程中。 【参考方案1】:

这意味着你的可变 NSSet 在枚举时发生了变化。

好的,检查您的代码后,您的代码不安全。您正在使用 MyAppDelegate.searchResultArray 作为表的数据源。这就是有时会导致您崩溃的原因。

想想如果在加载 UITableView 时 MyAppDelegate.searchResultArray 发生了变化会怎样?

在加载表格视图时,您应该确保数据源是静态的。最好将它设置在与您的 ViewController 相同的类上。

【讨论】:

你能解释一下吗...更多...我没有在 mu 代码中使用 NSSet。 你使用过集合数据类型吗?像 NSMutableArray 或 NSMuableSet?枚举这些集合数据时,不应在枚举时更改它。你说你的代码中根本没有使用 NSSet,但是有没有返回 NSSet 的方法?因为您的崩溃日志非常明显地说明了这一点。 对不起,我没有收到任何通知...我明白你的意思...我明天会检查我的代码并尝试做你建议的事情...如果我有任何疑问然后我会问你...谢谢你的朋友的帮助 1.您是否更改了数据源? 2. NSAutoLayout 是不同的主题,所以你可以在另一个线程中发布它。 但是如何更改我的数据源...当我向服务器请求相关数据时,它会响应我该数据并且我想将该数据显示到 tableview。我在请求的完成块中推送了 tableviewcontroller,在我获取响应并设置 myappdelegate.searchresult 之后。【参考方案2】:

我在 ios 7 中遇到了 NSLayoutConstraint 和 multiplier 的问题,ios 8 可以完美运行。

我正在使用乘数 whit 值 0.2 并导致错误!将值乘数更改为 1,并将屏幕尺寸的恒定值设置为 nslayoutconstraint。

NSLayoutConstraint(item: BT_Facebook, attribute: NSLayoutAttribute.Width, relatedBy: .Equal, toItem: nil, attribute: .Width, multiplier: 0.2, constant: sizeBtRedeSociais)

Solution is usage size of screen, and not percent.
var sizeBtRedeSociais = UIScreen.mainScreen().bounds.width / 5
var BT_FacebookWidth = NSLayoutConstraint(item: BT_Facebook, attribute: NSLayoutAttribute.Width, relatedBy: .Equal, toItem: nil, attribute: .Width, multiplier: 1, constant: sizeBtRedeSociais)
    var BT_TwitterWidth = NSLayoutConstraint(item: BT_Twitter, attribute: NSLayoutAttribute.Width, relatedBy: .Equal, toItem: nil, attribute: .Width, multiplier: 1, constant: sizeBtRedeSociais)
    var BT_InstagramWidth = NSLayoutConstraint(item: BT_Instagram, attribute: NSLayoutAttribute.Width, relatedBy: .Equal, toItem: nil, attribute: .Width, multiplier: 1, constant: sizeBtRedeSociais)
    var BT_GoogleWidth = NSLayoutConstraint(item: BT_Google, attribute: NSLayoutAttribute.Width, relatedBy: .Equal, toItem: nil, attribute: .Width, multiplier: 1, constant: sizeBtRedeSociais)
    var BT_YoutubeWidth = NSLayoutConstraint(item: BT_Youtube, attribute: NSLayoutAttribute.Width, relatedBy: .Equal, toItem: nil, attribute: .Width, multiplier: 1, constant: sizeBtRedeSociais)

【讨论】:

以上是关于崩溃应用程序的主要内容,如果未能解决你的问题,请参考以下文章

请教如何生成程序的崩溃日志

Spotify 应用程序崩溃而没有崩溃日志

应用程序在设备上崩溃,但 XCode 没有注册崩溃

在android中检测应用程序崩溃

应用程序在启动时崩溃 - 如何获取崩溃转储文件?

如果 Android 服务崩溃,它会导致它正在运行的应用程序崩溃吗?