English 中文(简体)
CNB 档案中的IDView子没有显示IB设计的ID。
原标题:iOS UIView subclass with NIB file does not display the UI designed in IB

我有一组人继承了国际律师联合会的意见,这一类人有一些控制,我已在国际律师联合会中控制。

然后,在为我的主要目击控制员撰写的NIB档案中,我发表了意见,将这一级改为我的子级,并为次级创建了一个小子。 然而,当我提出申请时,这封信件没有显示我上下等舱的“倡议”,只是空白。

我正在从次流中获取内流星和觉醒会尼布电文,这里是次流星卷的基本内容:

#import "AnalyticsDetailView.h"

@implementation AnalyticsDetailView

- (id)initWithCoder:(NSCoder *)aDecoder
{
    self = [super initWithCoder:aDecoder];
    return self;
}

- (void)awakeFromNib
{
    [super awakeFromNib];
}

- (id)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self)
    {
        NSArray *v = [[NSBundle mainBundle] loadNibNamed:@"AnalyticsDetailView" owner:self options:nil];
        [self addSubview:[v objectAtIndex:0]];
    }

    return self;
}

- (void)dealloc 
{
    [super dealloc];
}

@end

我不敢肯定,由于这种方法不是发射的,我怀疑它现在没有发生。 如果在我看到子级方法火力之后,我把时间点放在我的肩上,我可以看一看单子,而这个框架与我在B所创造的相同。

没有人会提出什么建议(放任法典、不良的IB联系等)来看待我错失或行为不正确的情况? 感谢。

最佳回答

为了让您的接口出现,你需要明确地从你的亲眼看望控制员那里传出一份内容详细的意见。

因此,在像<代码>viewDidLoad:或viewWillAppear:方法”等其他地方,你添加一条行文如下:

AnalyticsDetailView * newView = [[AnalyticsDetailView alloc] initWithFrame: CGRectMake(x,y,height,width)]; 
[parentView addSubview: newView];
[newView release]; // subview retains for us
问题回答

暂无回答




相关问题
List Contents of Directory in a UITableView

I am trying to list the contents of Ringtones directory in a TableView, however, I am only getting the last file in the directory in ALL cells, instead of file per cell. This is my code: - (...

iPhone NSUserDefaults persistance difficulty

In my app i have a bunch of data i store in the NSUserdefaults. This information consists of an NSObject (Object1) with NSStrings and NSNumbers and also 2 instances of yet another object (Object2). ...

Writing a masked image to disk as a PNG file

Basically I m downloading images off of a webserver and then caching them to the disk, but before I do so I want to mask them. I m using the masking code everyone seems to point at which can be found ...

Resize UIImage with aspect ratio?

I m using this code to resize an image on the iPhone: CGRect screenRect = CGRectMake(0, 0, 320.0, 480.0); UIGraphicsBeginImageContext(screenRect.size); [value drawInRect:screenRect blendMode:...

Allowing interaction with a UIView under another UIView

Is there a simple way of allowing interaction with a button in a UIView that lies under another UIView - where there are no actual objects from the top UIView on top of the button? For instance, ...

热门标签