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 > iPhone SDK Development Forums > iPhone SDK Development

Reply
 
LinkBack Thread Tools Display Modes
Old 02-09-2010, 06:46 PM   #1 (permalink)
Registered Member
 
Join Date: Dec 2009
Posts: 40
Bitzal is on a distinguished road
Default plist + Map - General Question (hopefully)

Im struggling to understand how to add locations on a map from a plist.
How would i go to add different locations from the plist on the map?

annotation.coordinate =egg;
annotation.title = [dataItem objectForKey:@"Name"];
annotation.subtitle = [dataItem objectForKey:@"Address"];

Even then how would I set "egg" to have longitude and latitude values programmatically. So if i had 50 locations how would I pull it in without having hundreds line of code?

Then how would I have the name and address objectForKey move onto the next object.

So in theory im just asking how to add multiple locations onto a map from a plist (Im terrible at wording this). Sample code or just how to go about doing it would be a great help.

Thanks
Bitzal is offline   Reply With Quote
Old 02-09-2010, 09:28 PM   #2 (permalink)
Registered Member
 
Join Date: Oct 2009
Posts: 22
Peeks is on a distinguished road
Default

Since we don't have the luxury of placing custom objects into a collection class and then into a plist, you'll have to store your data in an arrangement that would make sense for you.

For me, I would have a plist of 1 array. The first four items of the array would contain the data of 1 location. The next four items of the array would contain the data of the 2nd location and so on.

You would then load the plist into an array. Loop through that array, constructing a custom object and then adding it into another array. You will then end up with an array of custom objects.

When assigning the coordinate value, you'll find out that it will not be accessible since it is readonly. You can create another CLLocation instance and initialize it with long, lat values (from your array) and then assign it to your location property for your annotation.
Peeks is offline   Reply With Quote
Old 07-31-2011, 03:50 PM   #3 (permalink)
Registered Member
 
Join Date: Sep 2010
Posts: 9
NSpehler is on a distinguished road
Talking MyPlistMap for iPhone & iPad

I know this thread might be very old.

But, for you developers that wants to load annotations from a property list (.plist) file, this CodeCanyon item might interest you:
Mobile - MyPlistMap for iPhone & iPad - CodeCanyon

Your .plist file is downloaded on your server remotely, and you don't even have to update your application in order to add more pins.

Moreover, this Xcode project is also fetching the annotations on your server to a Table View, so that your users can switch from Map mode & List mode.

I'm sorry for this advertisement, but I sincerely hoping this item will be saving you from some painful hours of coding !
NSpehler is offline   Reply With Quote
Reply

Bookmarks

Tags
annotation, map, plist

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Online Users: 322
6 members and 316 guests
2Apps1Day, akacaj, SLIC, soohyun, Techgirl-52, v1n2e7t
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,650
Threads: 94,115
Posts: 402,887
Top Poster: BrianSlick (7,990)
Welcome to our newest member, soohyun
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 10:06 PM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0