it looks like LocationHelper just stores the LastFoundLocation locally - so in your ViewDidLoad when you create a new instance of LocationHelper it has no access to the location found in the other instance of LocationHelper
have you tried storing the location in a static class, or user settings? On Wed, Nov 16, 2011 at 6:58 AM, Mittchel Van Vliet <[email protected]>wrote: > Hello everyone, > > Recently I started working with LocationServices but there goes something > wrong.. I'm storing the current location in a property and I'm trying to > get the value from that in a different class. The value gets filled, but > when I try to get the value its empty. > > I copied the source code Nic Wise provided me and editted that, getting > the location works perfectly but storing it and then retrieving it returns > coordinates: 0, 0. > The source code can be found here: > > http://pastebin.com/4aJcxyY5 > > In the FinishedLoading of AppDelegate I am retrieving the position by: > LocationHelper helper = new LocationHelper(); > helper.GetForCurrentLocation(); > > In the ViewDidLoad of a other class I am trying to retrieve the > information with: > > LocationHelper helper = new LocationHelper(); > var test = lastFoundLocation.Longitude.ToString(); > Console.WriteLine(test); > > I hope someone can assist me with my problem. > Thanks in advance! > > Regards, > Mittchel > > _______________________________________________ > MonoTouch mailing list > [email protected] > http://lists.ximian.com/mailman/listinfo/monotouch > >
_______________________________________________ MonoTouch mailing list [email protected] http://lists.ximian.com/mailman/listinfo/monotouch
