开发者

passing data between views on the iPhone using singletons

I am trying to use the code found here enter link description here to pass data between two views.

It is not working.

The only value that is available globally to me is the someProperty value that was set when the object was instantiated.

If I update someProperty and try and access it from another view it just spits out the value it was created with.

Basically I am unable to update the variables of the singleton.

What am I doing wrong?

Edit: Hey guys I found the solution: Basically I have a button that 1) reads login details from UITextFields and 2) flips the view and then displays the login details.

The problem was I was flipping the view before reading the variables, not giving the app enough time to read the var开发者_如何转开发iables. Making the function read the variables first and then flip the view solved it!

Thanks anyway guys :D

I am using it as instructed: I put MyManager *sharedManager = [MyManager sharedManager];

in each .m file that I want to access the data from.

Thanks very much for your time

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜