Ios 推式视图控制器

Ios 推式视图控制器,ios,uinavigationbar,push,pushviewcontroller,linphone,Ios,Uinavigationbar,Push,Pushviewcontroller,Linphone,我在appDelegate方法中添加了UINavigationBar。请检查我的屏幕截图。底部是我用过的UINavigationBar。在页面中间的历史按钮就在那里 在这里,当我单击历史按钮时,它无法转到HistoryViwController。因为我推不动风景。你能告诉我怎么推这里吗。当我点击history时,它只调用了一个调用,然后只调用了另一个类,只有我指定的UI。我怎么会在这里说话。请帮帮我 #import "UICallButton.h" #import "LinphoneManage

我在appDelegate方法中添加了UINavigationBar。请检查我的屏幕截图。底部是我用过的UINavigationBar。在页面中间的历史按钮就在那里

在这里,当我单击历史按钮时,它无法转到HistoryViwController。因为我推不动风景。你能告诉我怎么推这里吗。当我点击history时,它只调用了一个调用,然后只调用了另一个类,只有我指定的UI。我怎么会在这里说话。请帮帮我

#import "UICallButton.h"
#import "LinphoneManager.h"

#import <CoreTelephony/CTCallCenter.h>

@implementation UICallButton

@synthesize addressField;


#pragma mark - Lifecycle Functions

- (void)initUICallButton {
    [self addTarget:self action:@selector(touchUp:) forControlEvents:UIControlEventTouchUpInside];
}

- (id)init {
    self = [super init];
    if (self) {
        [self initUICallButton];
    }
    return self;
}

- (id)initWithFrame:(CGRect)frame {
    self = [super initWithFrame:frame];
    if (self) {
        [self initUICallButton];
    }
    return self;
}

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

- (void)dealloc {
    [addressField release];

    [super dealloc];
}


#pragma mark -

- (void)touchUp:(id) sender {


    NSString *address = [addressField text];
    NSString *displayName = nil;
    ABRecordRef contact = [[[LinphoneManager instance] fastAddressBook] getContact:address];
    if(contact) {
        displayName = [FastAddressBook getContactDisplayName:contact];
    }
    [[LinphoneManager instance] call:address displayName:displayName transfer:FALSE];

}

@end
#导入“UICallButton.h”
#导入“LinphoneManager.h”
#进口
@实现UICallButton
@综合地址域;
#pragma标记-生命周期功能
-(void)initUICallButton{
[self-addTarget:self-action:@selector(touchUp:)for ControlEvents:UIControlEventTouchUpInside];
}
-(id)init{
self=[super init];
如果(自我){
[自初始化调用按钮];
}
回归自我;
}
-(id)initWithFrame:(CGRect)帧{
self=[super initWithFrame:frame];
如果(自我){
[自初始化调用按钮];
}
回归自我;
}
-(id)initWithCoder:(NSCoder*)解码器{
self=[super initWithCoder:decoder];
如果(自我){
[自初始化调用按钮];
}
回归自我;
}   
-(无效)解除锁定{
[地址字段释放];
[super dealoc];
}
#布拉格标记-
-(无效)修补:(id)发送方{
NSString*地址=[addressField text];
NSString*displayName=nil;
ABRecordRef contact=[[LinphoneManager实例]fastAddressBook]getContact:address];
如果(联系){
displayName=[FastAddressBook getContactDisplayName:contact];
}
[[LinphoneManager实例]调用:地址displayName:displayName传输:FALSE];
}
@结束

基本上,您必须有一个
UINavigationController
,而不仅仅是一个
UINavigationBar
,才能执行到一个
UIViewController
到另一个
的推式转换

我不会解释怎么做,因为这是非常基本的,在开始一个真正的项目之前,你应该学习和阅读一些书/教程

以下是一些帮助您的链接:

  • (来自苹果)


  • 你能显示一些代码吗?我附加的图像视图是HomeView控制的,但当我单击历史记录时,它会调用UICallButton.m。你粘贴的代码与按下视图控制器无关。但我的主页上只有我使用过UINavigationController。当我单击它时,它不被称为任何UIViewController。它在其名为TPMultiLayoutViewController之后调用了一个类。这就是我不能在没有导航控制器的情况下放置pushview控制器的地方。