Passing an object between view controllers, does the object become null in new controller?

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?


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!

Need Your Help

Pass value of same component as parameter to p:ajax listener: “PropertyNotFoundException”

java ajax jsf jsf-2 primefaces

I already typed the value within the brackets ('06717-100'), and the method is working, but I don't know how to pass the value of that same component as a parameter. I want the user to type a zipco...

Test run cron entry

linux unix cron crontab

I added a cron job recently, but made a mistake in the path while giving the command and hence, the job never succeeded. Is there some way to test the cron changes we have done?

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.