0

i am importing MFSideMenu to my dummy project. i am using the following codes

.h file

#import <UIKit/UIKit.h>
#import "MFSideMenu.h"
#import "RightSideViewController.h"
#import "MFSideMenuContainerViewController.h"

@interface xyzAppDelegate : UIResponder <UIApplicationDelegate>

@property (strong, nonatomic) UIWindow *window;
@property(strong,nonatomic)UINavigationController * navigationController;
@property(strong, nonatomic) RightSideViewController * rightViewController;
@property(strong, nonatomic) MFSideMenuContainerViewController * container;

and .m file is

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
    // Override point for customization after application launch.


self.window= [[UIWindow alloc]initWithFrame:[[UIScreen mainScreen]bounds]];

UIStoryboard * mainstoryboard = [UIStoryboard storyboardWithName:@"main" bundle:nil];
xyzViewController * vc = [mainstoryboard instantiateViewControllerWithIdentifier:@"xyzViewController"];
[self.navigationController pushViewController:vc animated:YES];

self.navigationController = [[UINavigationController alloc]initWithRootViewController:vc];



    self.rightViewController = [[RightSideViewController alloc]init];

    self.container = [MFSideMenuContainerViewController containerWithCenterViewController:self.navigationController leftMenuViewController:nil rightMenuViewController:_rightViewController];
    self.window.rootViewController = _container;
    [self.window makeKeyAndVisible];

    return YES;
}

the problem arise when i run the project it shows black screen only nothing else on simulator.

please help me to solve this issue

4

1 に答える 1

0

私は自分でそれを解決します @pkc456 に感謝します

次のコードを .m ファイルに追加したところ、正常に動作するようになりました

self.window= [[UIWindow alloc]initWithFrame:[[UIScreen mainScreen]bounds]];
UIStoryboard * mainstoryboard = [UIStoryboard storyboardWithName:@"main" bundle:nil];
xyzViewController * vc = [mainstoryboard instantiateViewControllerWithIdentifier:@"xyzViewController"];
[self.navigationController pushViewController:vc animated:YES];

self.navigationController = [[UINavigationController alloc]initWithRootViewController:vc];
于 2016-07-13T06:28:09.610 に答える