Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

Make your own iPhone apps
and run them live!
(free)

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum

View Single Post
Old 06-11-2009, 07:05 PM   #9 (permalink)
Robby
Registered Member
 
Join Date: May 2009
Location: Auckland, New Zealand
Posts: 16
Robby is on a distinguished road
Send a message via Skype™ to Robby
Default

Quote:
Originally Posted by alain55 View Post
I use global var to pass data between two views but this seems not to work between two non-adjacent views. Let me explain.

1. I write the glob var in view 1.
2. I push down in view 2, I can read the global var ok.
3. I push down in view 3, the global var are not there anymore.

I have also tried to copy the glob vars in view 2 to new ones, and these are
not readable in view 3

Any ideas why this behavior? and are glob var really global throughout the whole app or just on one view controller.
Have you included the header for view 1 in view 4?
I have seen on occasions global variable losing scope, but it's normally due to the fact that I haven't reference them correctly.
Globals can be dangerous in this respect.
Hope this helps.
Robby is offline   Reply With Quote
 

» Advertisements
» Online Users: 440
18 members and 422 guests
7twenty7, AppsBlogger, baja_yu, benney_swet, bonjobin, buggen, BumChinBooth, ChrisYates, dylanreich, evilmatt10, jeroenkeij, JoeRCruso, Kirkout, rraagg, samdanielblr, smithdale87, teebee74, TheStalker
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,636
Threads: 94,101
Posts: 402,816
Top Poster: BrianSlick (7,990)
Welcome to our newest member, samdanielblr
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 10:23 AM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.