从ios中的另一个视图中关闭显示的视图控制器
我有一个名为a的ViewController。它包含一个按钮,用于显示名为从ios中的另一个视图中关闭显示的视图控制器,ios,objective-c,xcode,navigation,presentmodalviewcontroller,Ios,Objective C,Xcode,Navigation,Presentmodalviewcontroller,我有一个名为a的ViewController。它包含一个按钮,用于显示名为LinkedInWebVC的新ViewController。 现在,我想从a中删除一个LinkedInWebVC 我的代码如下: 不要调用self而是尝试调用\u loginWebViewController [_loginWebViewController dismissViewControllerAnimated:YES completion: ^{
LinkedInWebVC
的新ViewController。
现在,我想从a中删除一个LinkedInWebVC
我的代码如下:
不要调用
self
而是尝试调用\u loginWebViewController
[_loginWebViewController dismissViewControllerAnimated:YES completion: ^{
self.oauth1Controller = nil;
}];
不要调用
self
而是尝试调用\u loginWebViewController
[_loginWebViewController dismissViewControllerAnimated:YES completion: ^{
self.oauth1Controller = nil;
}];
不要调用
self
而是尝试调用\u loginWebViewController
[_loginWebViewController dismissViewControllerAnimated:YES completion: ^{
self.oauth1Controller = nil;
}];
不要调用
self
而是尝试调用\u loginWebViewController
[_loginWebViewController dismissViewControllerAnimated:YES completion: ^{
self.oauth1Controller = nil;
}];
您可以更改:
[self dismissViewControllerAnimated:YES completion..]
到
因为这个“自我”存在于ViewController中。您可以更改:
[self dismissViewControllerAnimated:YES completion..]
到
因为这个“自我”存在于ViewController中。您可以更改:
[self dismissViewControllerAnimated:YES completion..]
到
因为这个“自我”存在于ViewController中。您可以更改:
[self dismissViewControllerAnimated:YES completion..]
到
因为这个“自我”存在于ViewController中。按照以下简单步骤从secondView控制器调用一个视图,并从mainView控制器中取消它,然后立即调用第三个视图控制器
步骤1:创建一个包含协议的.h文件
// ViewDelegate.h
#import <Foundation/Foundation.h>
@protocol ViewDelegate <NSObject>
- (void)DismissSecondView;
@end
步骤4:在SecondViewController.h文件中为委托分配属性
// ViewController.h
#import <UIKit/UIKit.h>
#import "SecondViewController.h"
#import "ThirdViewController.h"
#import "ViewDelegate.h"
@interface ViewController : UIViewController<ViewDelegate>
@property (weak, nonatomic) IBOutlet UILabel *FirstView;
-(void)PresentThirdView;
@end
// SecondViewController.h
#import <UIKit/UIKit.h>
#import "ViewController.h"
#include "ViewDelegate.h"
@interface SecondViewController : UIViewController
@property (nonatomic, assign) id <ViewDelegate> delegate;
@end
按照以下简单步骤从secondView控制器调用一个视图,并从mainView控制器取消该视图,然后立即调用第三个视图控制器
步骤1:创建一个包含协议的.h文件
// ViewDelegate.h
#import <Foundation/Foundation.h>
@protocol ViewDelegate <NSObject>
- (void)DismissSecondView;
@end
步骤4:在SecondViewController.h文件中为委托分配属性
// ViewController.h
#import <UIKit/UIKit.h>
#import "SecondViewController.h"
#import "ThirdViewController.h"
#import "ViewDelegate.h"
@interface ViewController : UIViewController<ViewDelegate>
@property (weak, nonatomic) IBOutlet UILabel *FirstView;
-(void)PresentThirdView;
@end
// SecondViewController.h
#import <UIKit/UIKit.h>
#import "ViewController.h"
#include "ViewDelegate.h"
@interface SecondViewController : UIViewController
@property (nonatomic, assign) id <ViewDelegate> delegate;
@end
按照以下简单步骤从secondView控制器调用一个视图,并从mainView控制器取消该视图,然后立即调用第三个视图控制器
步骤1:创建一个包含协议的.h文件
// ViewDelegate.h
#import <Foundation/Foundation.h>
@protocol ViewDelegate <NSObject>
- (void)DismissSecondView;
@end
步骤4:在SecondViewController.h文件中为委托分配属性
// ViewController.h
#import <UIKit/UIKit.h>
#import "SecondViewController.h"
#import "ThirdViewController.h"
#import "ViewDelegate.h"
@interface ViewController : UIViewController<ViewDelegate>
@property (weak, nonatomic) IBOutlet UILabel *FirstView;
-(void)PresentThirdView;
@end
// SecondViewController.h
#import <UIKit/UIKit.h>
#import "ViewController.h"
#include "ViewDelegate.h"
@interface SecondViewController : UIViewController
@property (nonatomic, assign) id <ViewDelegate> delegate;
@end
按照以下简单步骤从secondView控制器调用一个视图,并从mainView控制器取消该视图,然后立即调用第三个视图控制器
步骤1:创建一个包含协议的.h文件
// ViewDelegate.h
#import <Foundation/Foundation.h>
@protocol ViewDelegate <NSObject>
- (void)DismissSecondView;
@end
步骤4:在SecondViewController.h文件中为委托分配属性
// ViewController.h
#import <UIKit/UIKit.h>
#import "SecondViewController.h"
#import "ThirdViewController.h"
#import "ViewDelegate.h"
@interface ViewController : UIViewController<ViewDelegate>
@property (weak, nonatomic) IBOutlet UILabel *FirstView;
-(void)PresentThirdView;
@end
// SecondViewController.h
#import <UIKit/UIKit.h>
#import "ViewController.h"
#include "ViewDelegate.h"
@interface SecondViewController : UIViewController
@property (nonatomic, assign) id <ViewDelegate> delegate;
@end
您可以使用delegate执行相同的操作您可以使用delegate执行相同的操作您可以使用delegate执行相同的操作您可以使用delegate执行相同的操作