Hi, Does anyone know how to store GPS coordinates in a .plist file as a number?
It seems the dictionary doesn't read any of the numbers after the decimal point.
For example, I put a key of Lat, type Number, and value of 40.389771 and a Long of
-119.503304, and the map goes to Latitude 40, and Longitude -119.
The 'Number' type is equivalent to an Integer in that it will truncate anything after the decimal. You can try multiplying all Lat/Long pairs by a constant (10^x) to get them out of decimal form, or store them as a String and convert them to Decimals in the application.
The 'Number' type is equivalent to an Integer in that it will truncate anything after the decimal. You can try multiplying all Lat/Long pairs by a constant (10^x) to get them out of decimal form, or store them as a String and convert them to Decimals in the application.
So how would I go about converting a string to a decimal?
Thanks so much for the help.
Hi, Does anyone know how to store GPS coordinates in a .plist file as a number?
It seems the dictionary doesn't read any of the numbers after the decimal point.
For example, I put a key of Lat, type Number, and value of 40.389771 and a Long of
-119.503304, and the map goes to Latitude 40, and Longitude -119.
Cocoanetics Parts Store – easy to use yet professionally looking components that you can use to spruce up your own apps. Augmented Reality, Calendar Control, Pin Lock or Purchase Button are only some examples. You get full source code, no static library crap, and lifetime support. Check it out today!
Hi,
Please any one can help me with some dummy code on how to store values into the plist and than retrieve it. I have have chucks of data in the tableview whichi want to store in the plist so that when user starts the application it is directed to last page which he/she viewed. I want technique on how i can store NSArray into the the plist through code. Any help will do. Thanx in advance
If you are using your own classes then you have to create a method that returns an NSDictionary with the data you want to save and construct an array or dictionary with these.
__________________
regards
Oliver Drobnik Cocoanetics - Our DNA is programmed in Objective-C.
Cocoanetics Parts Store – easy to use yet professionally looking components that you can use to spruce up your own apps. Augmented Reality, Calendar Control, Pin Lock or Purchase Button are only some examples. You get full source code, no static library crap, and lifetime support. Check it out today!
Thanx for the help. But i have one more issue now is this method overrides the array in the plist.As i will structure my plist in beginning and than i will simply override the required arrays at required points. So that i get the latest data while loading the application next time.
Thanx for the help. But i have one more issue now is this method overrides the array in the plist.As i will structure my plist in beginning and than i will simply override the required arrays at required points. So that i get the latest data while loading the application next time.
You are speaking in riddles my friend.
I get the sinking feeling that you might be better of looking into SQLite to store your data. Takes only a day to implement but then you get lots of benefits from that.
__________________
regards
Oliver Drobnik Cocoanetics - Our DNA is programmed in Objective-C.
Cocoanetics Parts Store – easy to use yet professionally looking components that you can use to spruce up your own apps. Augmented Reality, Calendar Control, Pin Lock or Purchase Button are only some examples. You get full source code, no static library crap, and lifetime support. Check it out today!
Actually i am using the sqlites in my application. Now my application displays list of people with the information about the person stored on my server. The table contains cells depending upon the search. Now if there are 50 cells i have to store all the fifty cell in the database rather it will be great if i store as nsarray into the plist. So next time user starts the application he is on that page as i will retrieve the data from the plist and not from the server.
Actually i am using the sqlites in my application. Now my application displays list of people with the information about the person stored on my server. The table contains cells depending upon the search. Now if there are 50 cells i have to store all the fifty cell in the database rather it will be great if i store as nsarray into the plist. So next time user starts the application he is on that page as i will retrieve the data from the plist and not from the server.
So depending on how you hold the data in memory you will have to serialize it to save it to disk. Contact me personally if you need more help beyond this point.
__________________
regards
Oliver Drobnik Cocoanetics - Our DNA is programmed in Objective-C.
Cocoanetics Parts Store – easy to use yet professionally looking components that you can use to spruce up your own apps. Augmented Reality, Calendar Control, Pin Lock or Purchase Button are only some examples. You get full source code, no static library crap, and lifetime support. Check it out today!