Speak now
Please Wait Image Converting Into Text...
Embark on a journey of knowledge! Take the quiz and earn valuable credits.
Challenge yourself and boost your learning! Start the quiz now to earn credits.
Unlock your potential! Begin the quiz, answer questions, and accumulate credits along the way.
General Tech Learning Aids/Tools 2 years ago
Posted on 16 Aug 2022, this text provides information on Learning Aids/Tools related to General Tech. Please note that while accuracy is prioritized, the data presented might not be entirely correct or up-to-date. This information is offered for general knowledge and informational purposes only, and should not be considered as a substitute for professional advice.
Turn Your Knowledge into Earnings.
I am using Apple's CoreDataBooks sample project as a learning aid for core data.
I modified the app so that when the app loads I show a menu page first - not the Books tableview (RootViewController).
I have done the following:
I created a menu page in interface builder (just a view with a button on it)
The CoreDataBooksAppDelegate.h now looks like this:
// for the menu @class MenuViewController; @interface CoreDataBooksAppDelegate : NSObject <UIApplicationDelegate> { NSManagedObjectModel *managedObjectModel; NSManagedObjectContext *managedObjectContext; NSPersistentStoreCoordinator *persistentStoreCoordinator; UIWindow *window; UINavigationController *navigationController; //for the menu MenuViewController *viewController; } - (IBAction)saveAction:sender; //for the menu @property (nonatomic, retain) IBOutlet MenuViewController *viewController; @property (nonatomic, retain, readonly) NSManagedObjectModel *managedObjectModel; @property (nonatomic, retain, readonly) NSManagedObjectContext *managedObjectContext; @property (nonatomic, retain, readonly) NSPersistentStoreCoordinator *persistentStoreCoordinator; @property (nonatomic, readonly) NSString *applicationDocumentsDirectory; @property (nonatomic, retain) IBOutlet UIWindow *window; @property (nonatomic, retain) IBOutlet UINavigationController *navigationController; @end
The CoreDataBooksAppDelegate.m looks like this:
#import "CoreDataBooksAppDelegate.h" #import "RootViewController.h" // for the menu #import "MenuViewController.h" @implementation CoreDataBooksAppDelegate @synthesize window; @synthesize navigationController; // for the menu @synthesize viewController; #pragma mark - #pragma mark Application lifecycle - (void)applicationDidFinishLaunching:(UIApplication *)application { RootViewController *rootViewController = (RootViewController *)[navigationController topViewController]; rootViewController.managedObjectContext = self.managedObjectContext; // for the menu [window addSubview:viewController.view]; // Configure and show the window [window makeKeyAndVisible]; }
The rest of CoreDataAppDelegete.m remains unchanged.
In the MenuViewController when the button is clicked, the following action takes place:
RootViewController *modalViewController1 = [[[RootViewController alloc] initWithNibName:nil bundle:nil] autorelease]; [self presentModalViewController:modalViewController1 animated:YES];
No matter what stage you're at in your education or career, TuteeHub will help you reach the next level that you're aiming for. Simply,Choose a subject/topic and get started in self-paced practice sessions to improve your knowledge and scores.
General Tech 9 Answers
General Tech 7 Answers
General Tech 3 Answers
General Tech 2 Answers
Ready to take your education and career to the next level? Register today and join our growing community of learners and professionals.