5

In my app there is a PointMode button. When I click on it 10 to 11 time there is no problem and the view will appear. But then after, it produces this error:

Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Could not load NIB in bundle: 'NSBundle < Simulator/4.1/Applications/04DF6214-383F-43DA-B2D2-C5B538B0095B/PW.app> (loaded)' with name 'PWPointMode''

I call that view like this.

PWPointMode *pointController = [[PWPointMode alloc]initWithNibName:@"PWPointMode" bundle:nil];
    self.objPointMode = pointController;
    [self.navigationController pushViewController:objPointMode animated:YES];
    [pointController release];

my application is universal app

Maerlyn
  • 33,687
  • 18
  • 94
  • 85
Harin
  • 867
  • 11
  • 23

3 Answers3

2

Harin

I show you code it`s by this you can load new view or nib and but u explain there as after 10-15 time of loading view your application going to show this message so for that you run your application in Performance Tool and check due to leak your resource memory not going to full. due to this problem also you get this Error message while application crash.

May be this one is useful to you...

AJPatel
  • 2,291
  • 23
  • 42
0

You probably mistyped the NIB Name, check it. Also verify this file in included into the app bundle. In the 'Copy bundle ressources' build phase.

  • He mentioned it works 10-11 times after that the error comes. So there is no chance he mistyped xib name. – Rahul Vyas Jul 15 '11 at 12:05
  • @Rahul, the log message is obvious, and Harin, could say anything. Anyway thanks for downvoting –  Jul 15 '11 at 12:07
  • @vince,Rahul is right.there is no mistyped xib. otherwise it not work..and thanks for answer..plz if u have any idea than tell me – Harin Jul 15 '11 at 12:51
  • @Harin, the problem lays elsewhere. your code is totally right, and you assure the nib name too –  Jul 15 '11 at 13:00
  • @Vince have idea when this type of error comes... it` not came usually but when i call that repeatedly than after it`s occurs crash. – Harin Jul 15 '11 at 13:03
  • I understand right both your comments and code, so obviously the problem is elsewhere. the code you provided it totally right –  Jul 15 '11 at 13:05
  • hmmm.. i check WATS problem. – Harin Jul 15 '11 at 13:09
-2

@Vince is right. The best way to prevent a misspell is by using

NSStringFromClass([myVCIvar class]);

Try autoreleasing the viewController before you push it, as when I have recieved that problem, I autorelease the instance and then push it and it works.

max_
  • 24,076
  • 39
  • 122
  • 211
  • with a UIViewController it should be. – max_ Jul 15 '11 at 12:06
  • @XcodeDev He mentioned it works 10-11 times after that the error comes. So there is no chance he mistyped xib name. – Rahul Vyas Jul 15 '11 at 12:07
  • 1
    It was just an addon to Vinces point. Therefore the -1 is irrelevant. Also, Vince said that you 'probably' mistyped it, not did mistype it. – max_ Jul 15 '11 at 12:08
  • It probably is a misnamed nib, either in code or the actual file. BTW if it really is named the same as the class, you can use initWithNibName:nil to use the current class name automatically. – Peter DeWeese Jul 15 '11 at 12:29
  • @Peter DeWeese my application is universal app than how to i differentiate xib. than ? – Harin Jul 15 '11 at 13:05