0

我在 appDelegate 方法中添加了 UINavigationBar。请检查我附加的屏幕截图。在底部是我使用了 UINavigationBar。在页面历史按钮的 middel 中。

在这里,当我单击历史按钮时,它无法进入 historyviwcontroller。因为我不能推视图。你能告诉我我怎么能推到这里。当我单击历史记录时,它只调用了一个调用,之后只调用了另一个类,只有我给了 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

在此处输入图像描述

4

1 回答 1

2

Basically, you must have a UINavigationController, and not just a UINavigationBar, in order to be able to perform a push transition to one UIViewController to another.

I'm not explaining how to do that because it's very basic, you should study and read some books/tutorials before begin a real project.

Here's some links to help you:

  1. A nice tutorial

  2. How to use navigation controllers (from apple)

  3. Navigation Controller class reference

于 2013-09-14T14:55:46.583 回答