Saturday, September 28, 2013

Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Could not load NIB in bundle:' NSBundle (loaded) 'with name' Comcell''

If that

Customize a uitableviewcell

How it can be added to a uitableview
as cell
Thank you
Reply:
- (UITableViewCell *) tableView: (UITableView *) tableView cellForRowAtIndexPath: (NSIndexPath *) indexPath
{
static NSString * CellIdentifier = @ "merge Second Cell";
ILSCMMergeSecondCell * cell = [tableView dequeueReusableCellWithIdentifier: CellIdentifier];
if (cell == nil) {
cell = [[[ILSCMMergeSecondCell alloc] initWithStyle: UITableViewCellStyleValue1 reuseIdentifier: CellIdentifier] autorelease];

}
/ / Configure the cell ...
}

This code ILSCMMergeSecondCell as a custom cell.


Reply:
quote 1 floor a21064346 reply:
- (UITableViewCell *) tableView: (UITableView *) tableView cellForRowAtIndexPath: (NSIndexPath *) indexPath
{
static NSString * CellIdentifier = @ "merge Second Cell";
ILSCMMergeSecon ......


My custom cell's name is ComCell.xib, identifier for the ComCell

Then as you said, my code

static NSString * CellIdentifier = @ "ComCell";
ComCell * cell = [tableView dequeueReusableCellWithIdentifier: CellIdentifier];
if (cell == nil) {
cell = [[[ComCell alloc] initWithStyle: UITableViewCellStyleValue1 reuseIdentifier: CellIdentifier] autorelease];
}

However, did not show up?
Reply:
My method:

static NSString * CellIdentifier = @ "ComCellIdentifier";
BOOL nibRegistered = NO;
if (! nibRegistered) {
UINib * nib = [UINib nibWithNibName: @ "Comcell" bundle: nil];
[TableView registerNib: nib forCellReuseIdentifier: CellIdentifier];
nibRegistered = YES;
}

ComCell * cell = [tableView dequeueReusableCellWithIdentifier: CellIdentifier];

Why always ComCell * cell = [tableView dequeueReusableCellWithIdentifier: CellIdentifier]; sentence

Error

Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Could not load NIB in bundle:' NSBundle (loaded) 'with name' Comcell''
Reply:
Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Could not load NIB in bundle:' NSBundle (loaded) 'with name' Comcell''

I do not XIB, direct code construct UI. . . . Background PNG images posted Zhang, facing tune coordinate wow

You above error is to say, can not you read in the default bundle hungry XIB file. . . NIB is XIB.

bundle is your app built path


Reply:
6th Floor a21064346 reply quote:
Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Could not load NIB in bundle:' NSBundle


The company said without considering compatibility, so we do not xib, and directly in the storyboard to write

But would like to ask, where is that NibName defined?

NibName is the file name? Let's say MyNib.xib it NibName is not that MyNib?
Reply:
html ios layout layout also seems more than strange!

I storyboard in uitableviewcell added a view

How to set its height?

Why my settings
CGRect transmitViewBounds = CGRectMake (0, 0, 270, 100);
[Cell.subView setBounds: transmitViewBounds];

In just loaded does not work, but then included in the draw when there is effect, but the effect is randomly appear in a cell on

Is how else ah?

No comments:

Post a Comment