Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/101.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios Xcode错误-未知类型名称';主页';_Ios_Objective C_Xcode - Fatal编程技术网

Ios Xcode错误-未知类型名称';主页';

Ios Xcode错误-未知类型名称';主页';,ios,objective-c,xcode,Ios,Objective C,Xcode,这是我关于stackoverflow的第一个问题。!干杯 请从下面的链接查看我的代码。我已将appdelegate.h、appdelegate.m、viewcotroller.h和.m复制粘贴到文本文档中,以供审阅 我将在下面详细解释我的问题 我试图通过代码以较小的规模重新创建UICatalog。我是一名应用程序开发实习生。这就是我到目前为止所做的 请记住,我对Xcode和Objective-C的了解非常有限。我使用的是Xcode 5.1.1 我已经为AppDelegate.h中的主页视图控

这是我关于stackoverflow的第一个问题。!干杯

请从下面的链接查看我的代码。我已将appdelegate.h、appdelegate.m、viewcotroller.h和.m复制粘贴到文本文档中,以供审阅

我将在下面详细解释我的问题

我试图通过代码以较小的规模重新创建UICatalog。我是一名应用程序开发实习生。这就是我到目前为止所做的

请记住,我对Xcode和Objective-C的了解非常有限。我使用的是Xcode 5.1.1

  • 我已经为AppDelegate.h中的主页视图控制器“HomePageViewController”创建了一个实例变量(HPVC)

  • 我已将此HPVC设置为rootviewcontroller

  • 声明并定义了一些实例变量

*但到目前为止,我已经陷入了一个循环

我知道导入过程以循环结束。但我无法修复它

请检查一下,给我一个答案。我可以开始我的项目,如果我能清除这个障碍

下面是错误的屏幕截图

//
//AppDelegate.h
//纽维目录1
//
//由Roshith Balendran于2014年4月18日创建。
//版权所有(c)2014 Roshith Balendran。版权所有。
//
#进口
#导入“HomePageViewController.h”
@接口AppDelegate:UIResponder
{
HomePageViewController*HPVC;
}
@属性(强,非原子)UIWindow*window;
@结束
//
//AppDelegate.m
//纽维目录1
//
//由Roshith Balendran于2014年4月18日创建。
//版权所有(c)2014 Roshith Balendran。版权所有。
//
#导入“AppDelegate.h”
@实现AppDelegate
-(BOOL)应用程序:(UIApplication*)应用程序使用选项完成启动:(NSDictionary*)启动选项
{
self.window=[[UIWindow alloc]initWithFrame:[[UIScreen mainScreen]bounds]];
//应用程序启动后自定义的覆盖点。
HPVC=[[HomePageViewController alloc]initWithNibName:@“HomePageViewController”捆绑包:nil];
self.window.rootViewController=HPVC;
self.window.backgroundColor=[UIColor whiteColor];
[self.window makeKeyAndVisible];
返回YES;
}
-(无效)应用程序将重新签名:(UIApplication*)应用程序
{
//当应用程序即将从活动状态移动到非活动状态时发送。这可能发生在某些类型的临时中断(如来电或短信)或用户退出应用程序并开始转换到后台状态时。
//使用此方法暂停正在进行的任务、禁用计时器和降低OpenGL ES帧速率。游戏应使用此方法暂停游戏。
}
-(无效)应用程序标识符背景:(UIApplication*)应用程序
{
//使用此方法释放共享资源、保存用户数据、使计时器无效,并存储足够的应用程序状态信息,以便在应用程序稍后终止时将其恢复到当前状态。
//如果您的应用程序支持后台执行,则会调用此方法而不是applicationWillTerminate:当用户退出时。
}
-(无效)应用程序将进入前台:(UIApplication*)应用程序
{
//作为从后台转换到非活动状态的一部分调用;在这里,您可以撤消进入后台时所做的许多更改。
}
-(无效)应用IDBECOMEACTIVE:(UIApplication*)应用
{
//重新启动应用程序处于非活动状态时暂停(或尚未启动)的所有任务。如果应用程序以前位于后台,可以选择刷新用户界面。
}
-(无效)申请将终止:(UIApplication*)申请
{
//当应用程序即将终止时调用。如果合适,请保存数据。另请参阅ApplicationIdentinterBackground:。
}
@结束
//
//HomePageViewController.h
//纽维目录1
//
//由Roshith Balendran于2014年4月18日创建。
//版权所有(c)2014 Roshith Balendran。版权所有。
//
#进口
@接口HomePageViewController:UIViewController
//所有视图的背景图像。
@属性(非原子,强)UIImageView*HomePageBG;
@属性(非原子,强)UIImageView*Page1ButtonBG;
@属性(非原子,强)UIImageView*Page2ControlsBG;
@属性(非原子,强)UIImageView*Page3TextFieldBG;
@属性(非原子,强)UIImageView*Page4TextView;
@属性(非原子,强)UIImageView*Page5Images;
@属性(非原子,强)UIImageView*第6页段;
@属性(非原子,强)UIImageView*第7页工具栏;
@属性(非原子,强)UIImageView*Page8Alerts;
@属性(非原子,强)UIImageView*Page9Transitions;
//主页元素。
@属性(非原子,强)UILabel*lblHomePageHeader;
@属性(非原子,强)UILabel*lblHomePageWelcome;
@属性(非原子,强)UIButton*BtnPage1;
@属性(非原子,强)UIButton*BtnPage2;
@属性(非原子,强)UIButton*BtnPage3;
@属性(非原子,强)UIButton*BtnPage4;
@属性(非原子,强)UIButton*BtnPage5;
@属性(非原子,强)UIButton*BtnPage6;
@属性(非原子,强)UIButton*BtnPage7;
@属性(非原子,强)UIButton*BtnPage8;
@属性(非原子,强)UIButton*BtnPage9;
@属性(非原子,强)UIButton*BtnChangeBGColor;
//未来更新。添加按钮以更改主页中的所有按钮颜色。
@结束
//
//HomePageViewController.m
//纽维目录1
//
//由Roshith Balendran于2014年4月18日创建。
//版权所有(c)2014 Roshith Balendran。版权所有。
//
#导入“HomePageViewController.h”
@接口HomePageViewController()
@结束
@HomePageViewController的实现
@合成HomePageBG;
@合成
//
//  AppDelegate.h
//  NewUICatalogue1
//
//  Created by Roshith Balendran on 18/04/14.
//  Copyright (c) 2014 Roshith Balendran. All rights reserved.
//

#import <UIKit/UIKit.h>
#import "HomePageViewController.h"


@interface AppDelegate : UIResponder <UIApplicationDelegate>

{
    HomePageViewController *HPVC;

}


@property (strong, nonatomic) UIWindow *window;

@end





    //
    //  AppDelegate.m
    //  NewUICatalogue1
    //
    //  Created by Roshith Balendran on 18/04/14.
    //  Copyright (c) 2014 Roshith Balendran. All rights reserved.
    //

    #import "AppDelegate.h"


    @implementation AppDelegate


    - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
    {
        self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
        // Override point for customization after application launch.

        HPVC=[[HomePageViewController alloc]initWithNibName:@"HomePageViewController" bundle:nil];
        self.window.rootViewController=HPVC;

        self.window.backgroundColor = [UIColor whiteColor];
        [self.window makeKeyAndVisible];
        return YES;
    }

    - (void)applicationWillResignActive:(UIApplication *)application
    {
        // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
        // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game.
    }

    - (void)applicationDidEnterBackground:(UIApplication *)application
    {
        // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. 
        // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
    }

    - (void)applicationWillEnterForeground:(UIApplication *)application
    {
        // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background.
    }

    - (void)applicationDidBecomeActive:(UIApplication *)application
    {
        // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
    }

    - (void)applicationWillTerminate:(UIApplication *)application
    {
        // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
    }

    @end


    //
    //  HomePageViewController.h
    //  NewUICatalogue1
    //
    //  Created by Roshith Balendran on 18/04/14.
    //  Copyright (c) 2014 Roshith Balendran. All rights reserved.
    //

    #import <UIKit/UIKit.h>

    @interface HomePageViewController : UIViewController

    //Background Images for all the Views.
    @property(nonatomic,strong) UIImageView *HomePageBG;
    @property(nonatomic,strong) UIImageView *Page1ButtonBG;
    @property(nonatomic,strong) UIImageView *Page2ControlsBG;
    @property(nonatomic,strong) UIImageView *Page3TextFieldBG;
    @property(nonatomic,strong) UIImageView *Page4TextView;
    @property(nonatomic,strong) UIImageView *Page5Images;
    @property(nonatomic,strong) UIImageView *Page6Segments;
    @property(nonatomic,strong) UIImageView *Page7Toolbar;
    @property(nonatomic,strong) UIImageView *Page8Alerts;
    @property(nonatomic,strong) UIImageView *Page9Transitions;

    //Home Page Elements.
    @property(nonatomic,strong) UILabel *lblHomePageHeader;
    @property(nonatomic,strong) UILabel *lblHomePageWelcome;
    @property(nonatomic,strong) UIButton *BtnPage1;
    @property(nonatomic,strong) UIButton *BtnPage2;
    @property(nonatomic,strong) UIButton *BtnPage3;
    @property(nonatomic,strong) UIButton *BtnPage4;
    @property(nonatomic,strong) UIButton *BtnPage5;
    @property(nonatomic,strong) UIButton *BtnPage6;
    @property(nonatomic,strong) UIButton *BtnPage7;
    @property(nonatomic,strong) UIButton *BtnPage8;
    @property(nonatomic,strong) UIButton *BtnPage9;
    @property(nonatomic,strong) UIButton *BtnChangeBGColor;





    //Future Update. Add Button to change all button colors in Home Page.

    @end


    //
    //  HomePageViewController.m
    //  NewUICatalogue1
    //
    //  Created by Roshith Balendran on 18/04/14.
    //  Copyright (c) 2014 Roshith Balendran. All rights reserved.
    //

    #import "HomePageViewController.h"

    @interface HomePageViewController ()

    @end

    @implementation HomePageViewController

    @synthesize HomePageBG;
    @synthesize Page1ButtonBG;
    @synthesize Page2ControlsBG;
    @synthesize Page3TextFieldBG;
    @synthesize Page4TextView;
    @synthesize Page5Images;
    @synthesize Page6Segments;
    @synthesize Page7Toolbar;
    @synthesize Page8Alerts;
    @synthesize Page9Transitions;

    @synthesize lblHomePageHeader;
    @synthesize lblHomePageWelcome;
    @synthesize BtnPage1;
    @synthesize BtnPage2;
    @synthesize BtnPage3;
    @synthesize BtnPage4;
    @synthesize BtnPage5;
    @synthesize BtnPage6;
    @synthesize BtnPage7;
    @synthesize BtnPage8;
    @synthesize BtnPage9;
    @synthesize BtnChangeBGColor;



    - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
    {
        self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
        if (self) {
            // Custom initialization
        }
        return self;
    }

    - (void)viewDidLoad
    {
        [super viewDidLoad];
        // Do any additional setup after loading the view.

        //Home Page Background image added.
        HomePageBG=[[UIImageView alloc]initWithFrame:CGRectMake(0, 0, 320, 568)];
        HomePageBG.image=[UIImage imageNamed:@"Red"];
        [self.view addSubview:HomePageBG];


    }

    - (void)didReceiveMemoryWarning
    {
        [super didReceiveMemoryWarning];
        // Dispose of any resources that can be recreated.
    }

    /*
    #pragma mark - Navigation

    // In a storyboard-based application, you will often want to do a little preparation before navigation
    - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
    {
        // Get the new view controller using [segue destinationViewController].
        // Pass the selected object to the new view controller.
    }
    */

    @end