-3

I am passing a uitextfield string over to a class method (+) with that method I want to instantiate a NSString with the value from the textfield that will be used in another method in the same class. However because this method is (+) I cannot use an instance variable without throwing an error.

How can I grab that uitextfield string thats in the class methods parameter and give it t an instance method?

would creating another local method be a good idea? one that could be called in the class method or is their an easier way?

tinhead
  • 385
  • 2
  • 10
  • 29

1 Answers1

0

I am not exactly sure what you are trying to do, but it sounds like you are trying to do something that belongs in a controller instead.

Johan Kool
  • 15,637
  • 8
  • 64
  • 81
  • I have a view controller and a database access class, I am trying to set a value in the access class so that it only sends back particular value from my database. this value is set by the user and resides in the viewcontroller, then when the user puts in a code then triggers the tableView:didSelectRowAtIndexPath: it should pass the value over to the dbaccess class. – tinhead Jun 13 '11 at 03:28
  • You normally would use an instance of your database access class to retrieve data. Set the variable on the instance of your access class, not the class itself. If you are using a class method because those are easier to access (no need to have a pointer), I suggest seeing if using a singleton would fit your need. – Johan Kool Jun 13 '11 at 04:38