I would like to get input on my solution to the challenge. I have it working perfectly but I’d like to get a second opinion on “Best Practices” I’ll just sketch out the steps I took.
- Create a new “MapViewController” class, and copy initializer methods from the another ViewController including the Designated Initializer method (with the UITabBarItems…adding a Map title and Map.png and so on) .
2.Copy the MapPoint.h and MapPoint .M from the WhereAmIAppDelegate project, to the HypnoTime (currentProject) so the data can be used by the new MapViewController class.
Import the “MapViewController.h” into the HypnoTimeAppDelegate.m, and declare MapViewController (vc3)to add to the tabBar. Test the app to see if the new third tab item is working.
In the new MapViewController.h, copy the necessary code from the “WhereAmIAppDelegate.h” , basically everything except the class name.
In the MapViewController.m, copy the following [NOTE: reconfiguration***]:
5a. You will copy all the methods from the “WhereAmIAppDelegate.m”, staring with
" -(BOOL)application:…didFinishLaunching…, to include “-(void)foundLocation:(CLLocation*) loc… place into the " MapViewController.m” (place it below the -(id)initWithNibName:…method)
5b.***Reconfigurion, do not use the "-(BOOL) application… "method. Instead copy the relevant “Location Manager” code from within that BOOL method, and use it in the “-(void) viewDidLoad …” Method of the MapViewController.m.
- Finally, Since we are not using the MainWindow.XIB to hold the MKMapView, We need to create a new XIB "UIView"for the MKMapView that goes into the MapViewController, Then you need add a “Object” to the XIB, to act as the connector to the MapVewController Class. Then make the connections.
I think thats it (sketchy as is is…) Sorry if I let stuff out I just want to see if my approach is on track.
Thanks in advance for any comments.