0

I have Checked all outlets and connections all seems fine.Can some one look into it and notice the fault, if any.Basically, this custom view is displayed over a view controller when user moves out of the specified region.

//  QMOutOfCountryView.m

 #import "QMOutOfCountryView.h"

 @implementation QMOutOfCountryView
 /*
 // Only override drawRect: if you perform custom drawing.
 // An empty implementation adversely affects performance during animation.
 - (void)drawRect:(CGRect)rect {
     // Drawing code
 }
 */

 +(QMOutOfCountryView*)loadFromNib{
     NSArray *nibArr = [[NSBundle mainBundle] loadNibNamed:@"QMOutOfCountryView" owner:self options:nil];
     QMOutOfCountryView *countryView;
     for (UIView * subview in nibArr) {
         if ([subview isKindOfClass:[QMOutOfCountryView class]]) {
             countryView = (QMOutOfCountryView *)subview;
             break;
         }
     }
     return countryView;
 }
 -(void)setdataOnViewWith:(int)viewType {
     if (viewType == location) {
         iconImage.image = [UIImage imageNamed:@"locationoff"];
         messageTextView.text = kLocationViewMessage;
     } else if (viewType == outOfCountry) {
         iconImage.image = [UIImage imageNamed:@"illustration"];
         messageTextView.text = kOutOfCountryViewMessage;
     }
     messageTextView.textColor = [UIColor blackColor];
     messageTextView.font = [UIFont fontWithName:@"SFUIDisplay-Light" size:16.0f];
 }
 @end
Fruchtzwerg
  • 10,999
  • 12
  • 40
  • 49
Uday Singh
  • 441
  • 4
  • 4
  • what is the crash log says? – Akhilrajtr Aug 10 '17 at 06:40
  • Show us your crash log? – stardust Aug 10 '17 at 07:33
  • Aside from showing the crash log, consider adding an exception breakpoint, which will point to the line that is forcing the crash. You can follow this link: https://stackoverflow.com/questions/17802662/exception-breakpoint-in-xcode – Alan Aug 10 '17 at 07:52
  • NSArray *nibArr = [[NSBundle mainBundle] loadNibNamed:@"QMOutOfCountryView" owner:self options:nil]; this is the line which causing crash. – Uday Singh Aug 10 '17 at 08:16
  • #0. Crashed: com.apple.main-thread 0 libobjc.A.dylib objc_msgSend + 28 1 UIKit -[UINibStringIDTable dealloc] + 84 2 UIKit -[UINibDecoder dealloc] + 360 4 libobjc.A.dylib object_cxxDestructFromClass(objc_object*, objc_class*) + 148 5 libobjc.A.dylib objc_destructInstance + 92 6 libobjc.A.dylib object_dispose + 28 7 libobjc.A.dylib object_cxxDestructFromClass(objc_object*, objc_class*) + 148 – Uday Singh Aug 10 '17 at 08:18
  • 8 libobjc.A.dylib objc_destructInstance + 92 9 libobjc.A.dylib object_dispose + 28 10 UIKit -[UINib dealloc] + 176 11 UIKit -[NSBundle(UINSBundleAdditions) loadNibNamed:owner:options:] + 244 12 Q-municate +[QMOutOfCountryView loadFromNib] (QMOutOfCountryView.m:23) 13 Q-municate -[QMDialogsViewController configureCountryView] (QMDialogsViewController.m:359) 14 Q-municate -[QMDialogsViewController viewDidLoad] (QMDialogsViewController.m:156) 15 UIKit -[UIViewController loadViewIfRequired] + 996 16 UIKit -[UINavigationController _layoutViewController:] + 72 – Uday Singh Aug 10 '17 at 08:20
  • Most important; this crash is not seen in development, it works fine. The crash is random. – Uday Singh Aug 10 '17 at 08:21

0 Answers0