Sono piuttosto nuovo all'obiettivo c e ho alcuni problemi di base.nome di tipo sconosciuto nell'obiettivo c
Ho scritto un semplice programma utilizzando un navigatore e tutto ha funzionato bene. poi ho aggiunto poche righe di codice (non riesco nemmeno a ricordare cosa esattamente, e sembra non avere alcuna connessione al problema) e il problema si è verificato. Ho provato Ctrl + z, e il problema rimasto:
corro il programma e ottengo questi errori:
1. unknown type name "mainController"
2. property with 'retain (or strong)' attribute must be of object type
mentre MainController è la prima schermata da caricare.
Questo è il file appDelegate.h:
#import <UIKit/UIKit.h>
#import "mainController.h"
#import "WishesList.h"
#import "Wish.h"
@interface AppDelegate : UIResponder <UIApplicationDelegate>
@property (strong, nonatomic) UIWindow *window;
@property (strong, nonatomic) IBOutlet UINavigationController *navController;
@property (strong, nonatomic) IBOutlet mainController *viewController; // this line creates the errors
@property (strong, nonatomic) WishesList *WishesArray;
@property (strong, nonatomic) NSIndexPath *temp;
@end
questa è la parte rilevante del file appDelegate.m:
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions: (NSDictionary *)launchOptions
{
self.window = [[UIWindow alloc]initWithFrame:[[UIScreen mainScreen]bounds]];
WishesArray = [[WishesList alloc]init];
temp = nil;
[self setViewController:[[mainController alloc]init]];
[self setNavController:[[UINavigationController alloc]initWithRootViewController:self.viewController]];
[self.window setRootViewController:navController];
[self.window makeKeyAndVisible];
return YES;
}
E questo è mainController.h:
#import <UIKit/UIKit.h>
#import "addWishController.h"
#import "displayWish.h"
#import "WishesList.h"
#import "Wish.h"
@interface mainController : UIViewController
@property (nonatomic, weak) WishesList *list;
@property (nonatomic, strong) IBOutlet UITableView *wishTable;
- (void)addWish;
@end
ha già funzionato ...
puoi capirlo?
grazie
Mostraci 'MainController. per favore. – mattjgalloway
Esiste una classe definita con il nome 'mainController'? –
Ho aggiunto mainController.h così puoi vederlo anche –