delegates - iOS - How to send a reference to a MapView nested within a UITabBarController -


This may be a simple question, but I took one of my apps from a visual based application in a window based application. Gaya. In the original app, I had a view controller and a map. I had a class that parsed some data and it was sent to the view controller. I used the following code from class to send data to classbase, which adds an annotation.

  Animation Probable App Delayed * App Delegate = (Annotation Problems App Delayed *) [[UIPACC Share Epicelling]]]; [AppDelegate.viewController Load Annotation];   

I can not assign view controller because it will create a new instance of the view controller. When creating a class, I have to pass the context of the View Controller. I

Now when the map view is nested inside the UITBB Controller, then I am not sure how I reference the class from Classbie Passing along the nearest map. Do I need to add a new representative method or start the protocol? I hope this is enough information to tell me that I can make someone else clear.

Thank you in advance!

I understood it from myself [[UIApplication sharedApplication] delegate] to call me Your window-based application was coded to add everything.

  1. I declared an IBOuttlet for my class "

  2. P>

    IBOutlet MyClass * myClass;

  3. Make my IBOutlet a property

    @property (nonatomic, retain) IBOutlet MyClass * myClass;

  4. Synchronize the property (be sure to release it too)

    Synchronize @ myClass;

  5. Connect the iBootlet to the View Controller in the Interface Builder in my app on which a Navigation inside the Tab Bar Controller and Tab Bar Controller Gation was the controller, I had to make sure that IBotlet went to the visual controller which was nested with navigation controllers.

  6. Finally, my other classes referred to myClass To do this, I have called the UIApplication shared application with the following code:

    MyAppDelegate * appDelegate = (MyAppDelegate *) [[UIApplication shared epicling]]]; [AppDelegate.myClass methodBeingCalled]; < / Li>

    I hope that if you come into the same problem then Ddgar will!

Comments