Dier02
asked on
problem with line of code
// RootViewController.h
// Locations
//
// Created by me on 6/07/11.
// Copyright (c) 2011 __MyCompanyName__. All rights reserved.
//
#import <Foundation/Foundation.h>
#import <CoreData/CoreData.h>
#import <CoreLocation/CoreLocation .h>
@interface RootViewController : UITableViewController <CLLocationManagerDelegate > {
NSMutableArray *eventsArray;
NSManagedObjectContext *managedObjectContext;
CLLocationManager *locationManager;
UIBarButtonItem *addButton;
}
@property (nonatomic, retain) NSMutableArray *eventsArray;
@property (nonatomic, retain) NSManagedObjectContext *managedObjectContext;
@property (nonatomic, retain) CLLocationManager *locationManager;
@property (nonatomic, retain) UIBarButtonItem *addButton;
@interface RootViewController : NSManagedObject {@private //this line comes up with two errors - a missing @ and a '(' //
}
@end
// Locations
//
// Created by me on 6/07/11.
// Copyright (c) 2011 __MyCompanyName__. All rights reserved.
//
#import <Foundation/Foundation.h>
#import <CoreData/CoreData.h>
#import <CoreLocation/CoreLocation
@interface RootViewController : UITableViewController <CLLocationManagerDelegate
NSMutableArray *eventsArray;
NSManagedObjectContext *managedObjectContext;
CLLocationManager *locationManager;
UIBarButtonItem *addButton;
}
@property (nonatomic, retain) NSMutableArray *eventsArray;
@property (nonatomic, retain) NSManagedObjectContext *managedObjectContext;
@property (nonatomic, retain) CLLocationManager *locationManager;
@property (nonatomic, retain) UIBarButtonItem *addButton;
@interface RootViewController : NSManagedObject {@private //this line comes up with two errors - a missing @ and a '(' //
}
@end
ASKER
well, I would have thought that it was clear that I have no idea:) but that line came up with those two errors and I am trying to understand why. As to why? Its from a tutorial that I obviously do not understand.
"no idea" assumptions are dangerous to make :-)
Remove that line.
If you still get errors then let us know what they are.
Is your tutorial online, can you show the URL? there must be something more to this.
Remove that line.
If you still get errors then let us know what they are.
Is your tutorial online, can you show the URL? there must be something more to this.
ASKER
OK- here comes the intelligent question:
First the code:
/
// FileExampleAppDelegate.m
// FileExample
//
// Created by Reid Moule on 6/07/11.
// Copyright 2011 __MyCompanyName__. All rights reserved.
//
#import "FileExampleAppDelegate.h"
#import "FileExampleViewController .h"
@implementation FileExampleAppDelegate
@synthesize window=_window;
@synthesize viewController=_viewContro ller;
- (BOOL)application:(UIAppli cation *)application didFinishLaunchingWithOpti ons:(NSDic tionary *)launchOptions
{
// Override point for customization after application launch.
self.window.rootViewContro ller = self.viewController;
[self.window makeKeyAndVisible];
return YES;
}
- (void)applicationWillResig nActive:(U IApplicati on *)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)applicationDidEnterB ackground: (UIApplica tion *)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)applicationWillEnter Foreground :(UIApplic ation *)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)applicationDidBecome Active:(UI Applicatio n *)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)applicationWillTermi nate:(UIAp plication *)application
{
/*
Called when the application is about to terminate.
Save data if appropriate.
See also applicationDidEnterBackgro und:.
*/
}
- (void)dealloc
{
[_window release];
[_viewController release];
[super dealloc];
}
@end
How many of the above are optional? Could I use just one and delete everything down to the @end
First the code:
/
// FileExampleAppDelegate.m
// FileExample
//
// Created by Reid Moule on 6/07/11.
// Copyright 2011 __MyCompanyName__. All rights reserved.
//
#import "FileExampleAppDelegate.h"
#import "FileExampleViewController
@implementation FileExampleAppDelegate
@synthesize window=_window;
@synthesize viewController=_viewContro
- (BOOL)application:(UIAppli
{
// Override point for customization after application launch.
self.window.rootViewContro
[self.window makeKeyAndVisible];
return YES;
}
- (void)applicationWillResig
{
/*
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)applicationDidEnterB
{
/*
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)applicationWillEnter
{
/*
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)applicationDidBecome
{
/*
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)applicationWillTermi
{
/*
Called when the application is about to terminate.
Save data if appropriate.
See also applicationDidEnterBackgro
*/
}
- (void)dealloc
{
[_window release];
[_viewController release];
[super dealloc];
}
@end
How many of the above are optional? Could I use just one and delete everything down to the @end
ASKER
or do I just add what I want to happen and leave the rest intactico?
I do not know the answer to you question, it depends on you full app as far as I know, thus to be on the safe side leave them.
For each property I think you will need to synthesize.
For each property I think you will need to synthesize.
ASKER
why?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
"@interface RootViewController : NSManagedObject {@private //this line comes up with two errors - a missing @ and a '(' //
}"