iPhone: Access a class from another class -


I want to create a program that parses an XML file and then updates the labels on 2 separate tab bar views On both of these ideas, I have a fresh button to update the result. What do I want to do, both visual labels are updated by either viewing I understand that AppDelegate is probably a good option to do this, but I tried to create classes that can use appellage but Since they are examples of a class, they have no value. I do not get any errors but do not update the labels, although the data changes, this is the method in my appellate which is called after the XML is parsed:

  - (zero) Callupdate Value {NSLog (@ "Updating Updating From Calling"); Home * Home Controller; Data * data controller; [Home Controller Update Value]; [Data Controller Update Price]; }  

One of the update methods looks like this:

  - (zero) updated values ​​{NSLog (@ "call home"); [Label 1 settext: [[Total data object overindex x 0] ObjectForreqi: @ "nodeshieldarrere"] ObjectAttexX: 7] Welfare: @ "node content"]]; [Label 2 settext: [[Total data object overindex: 0] objectfore: @ "node child other"] ObjectOtindex: 1] Valaphoric: @ "node content"]]; }  

The View App Delegate method says "callUpdateValues" and then that method should call individual "updateValues" methods in each view. I'm not an expert on this anyhow, and I'm actually trying to figure out how programming works on the work of the iPhone. I probably do not understand anything here, and if someone can answer me some kind of thing then I appreciate it.

Several sections are available to inform parties interested in cocoa to make direct calls The methods you make as much as you need, make it more consistent.

In your method, which you have updated:

  [[NSNotificationCenter defaultCenter] PostNotificationName: @ "IGotSomeNewData" object: newData userInfo: zero];  

And for those sections who want to hear about updates, you will register for the notification:

  [[NSNotificationCenter defaultCenter] addObserver: self selector : @ Selector (new stuff :) Name: @ "iGot some new data" object: zero];  

And then implement the method that is said when something happens:

  - (zero) New Stuff: (NSN notification *) Notification {ID NewData = [information object]; // what stuff}  

Comments

Popular posts from this blog

c# - ListView onScroll event -

PHP - get image from byte array -

Linux Terminal Problem with Non-Canonical Terminal I/O app -