0

I am new to Objective C and trying to get my head around OOP in apps as opposed to web OOP.

Lets say I have a class theDay.h and theDay.m

setDay is a class which in one view controller it takes in a value, say a integer, via a set method, and then in another view controller using a get method you can get the value example: (if my syntax is wrong sorry, very new!)

[theDay setDay:1];

then to get it:

int day;
day = [theDay getDay];

Is this correct and is the object available throughout the views?

Josh Boothe
  • 1,413
  • 4
  • 25
  • 40

1 Answers1

0

Yes the object will be available! You are passing reference to that object, not the object!! But you have to allocate that object somewhere in the code!

This Link would help!

Community
  • 1
  • 1
Burhanuddin Sunelwala
  • 5,318
  • 3
  • 25
  • 51