ios - How can I access UITextFields from outside the ViewController (from a .m file)? -


i have class keep utility methods; 1 of methods takes values in textboxes stored in viewcontroller , saves values plist.

the problem utility methods class not viewcontroller , therefore can't "hook up" outlet properties of textboxes tothe utility class.

is there way can pass viewcontroller parameter utility class method?

just make utilities class singleton inheriting nsobject. way can access methods wherever you'd , you'll have 1 instance of it.

https://developer.apple.com/library/ios/documentation/general/conceptual/devpedia-cocoacore/singleton.html

matt gallagher wrote great helper file create singletons. check out here:

http://www.cocoawithlove.com/2008/11/singletons-appdelegates-and-top-level.html


Comments

Popular posts from this blog

Detect support for Shoutcast ICY MP3 without navigator.userAgent in Firefox? -

web - SVG not rendering properly in Firefox -

java - JavaFX 2 slider labelFormatter not being used -