0

we are a group working on an iPhone app. and its our first time. I just would like to know the easy way to implement a public class so that my partner can give me a variable that contains a value i need to use in my code. It doesn't have to be a class any other easy solution would work.

Just to make it more clear my friend has a value in his code that i need to use to display it on the screen "using my code". What i know is that everything has to communicate through a controller class which in this case the thing i need to implement my friend must be able to call it, give it the value then i take this value and display it. THANK YOU IN ADVANCE!

Zee
  • 172
  • 1
  • 5
  • 12

1 Answers1

1

I. Just make an property in .h

@property (nonatomic, retain) NSString *userName;

and in .m file

@synthesize userName;

Docs here

II. He can make and delegate protocol in his class, the you need to set your object to be the delegate of his class instance and implement the delegate method. When he has the vale will call the delegate method and you will recive it in your method.

Docs here

Alex Terente
  • 12,006
  • 5
  • 51
  • 71