iphone - Passing variable to another view (using Utility template) -


okay, i'm newbie, need passing variable view. i'm using utility template in xcode.

i think have linking (including proper header files , whatnot). don't know proper syntax. here's i'm trying:

nsdate *time =[flipsideviewcontroller.datepicker date]; 

if run in rootviewcontroller.toggleview works fine.

any would appreciated!

there different ways pass 1 variable view as:

1) crate global variable in appdelegateclass:

  1. in appdelegate.h crate vriable nsstring *str property
  2. in appdelegate.m syntheses it.
  3. in view1 set variable as:

    yourappdelegate *appdelegate= [[uiapplication sharedapplication] delegate];

appdelegate.str= @"some string";

  1. in view2 again crate same object , retrieve value. nsstring *mystr= appdelegate.str;

the way define property in view2 , access view one.


Comments

Popular posts from this blog

c++ - How do I get a multi line tooltip in MFC -

asp.net - In javascript how to find the height and width -

c# - DataTable to EnumerableRowCollection -