Link to home
Start Free TrialLog in
Avatar of Dier02
Dier02Flag for Australia

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
Avatar of darbid73
darbid73
Flag of Germany image

May I ask what you want or what you are thinking you want or where you got the idea to use this line

"@interface RootViewController : NSManagedObject {@private  //this line comes up with two errors - a missing @ and a '(' //
}"
Avatar of Dier02

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.
Avatar of Dier02

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=_viewController;

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
    // Override point for customization after application launch.
     
    self.window.rootViewController = self.viewController;
    [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:.
     */
}

- (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
Avatar of Dier02

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.
Avatar of Dier02

ASKER

why?
ASKER CERTIFIED SOLUTION
Avatar of darbid73
darbid73
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial