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 08-05-2010, 04:17 AM   #1 (permalink)
Registered Member
 
Join Date: Mar 2010
Location: Warwickshire, United Kingdom
Posts: 163
dcjones is on a distinguished road
Default Updating my App

Hi all,

A few weeks ago I submitted my App to the App sot which was reviewed and passed with no problems. The App has an SQLite database which hold the latitude and longitude of some airports. When tapping a button a view of the airport is displayed. All is working as expected.

Two weeks ago I submitted an update which passed review and is now on the Apps store ready to download as an update.

After doing the update on to my own iPhone I now have a problem. If I tap the button to display the airport view, the map loads but not at the correct latitude and longitude. I then deleted the App from my iPhone and downloaded is again and everything is working correctly.

Can anyone throw some light on to why this should happen.
__________________
Many thanks, keep safe and well.



Dereck
dcjones is offline   Reply With Quote
Old 08-05-2010, 04:21 AM   #2 (permalink)
Registered Member
 
CambridgeCoders's Avatar
 
Join Date: Jul 2010
Location: Cambridge, UK
Posts: 73
CambridgeCoders is on a distinguished road
Default

Hi,

Did you change the format of the database in any way? Add or remove tables? Have you changed your app's preferences?

Best regards,
__________________
Andy, Cambridge Coders Limited, www.cambridgecoders.com
Calcuccino - scientific calculator for the iPhone
CambridgeCoders is offline   Reply With Quote
Old 08-05-2010, 04:35 AM   #3 (permalink)
Registered Member
 
Join Date: Mar 2010
Location: Warwickshire, United Kingdom
Posts: 163
dcjones is on a distinguished road
Default

Hi and many thanks for your reply.

The database is the same it just contains additional records.

Do you know how this update business works. Is it the case that when an update is downloaded does it:

a: delete the app from the iPhone before installing the update
b: overwrite the complete app
c: update parts of the app

This is a very strange one and has me at a scratching my head.
__________________
Many thanks, keep safe and well.



Dereck
dcjones is offline   Reply With Quote
Old 08-05-2010, 05:12 AM   #4 (permalink)
Registered Member
 
CambridgeCoders's Avatar
 
Join Date: Jul 2010
Location: Cambridge, UK
Posts: 73
CambridgeCoders is on a distinguished road
Default

Hi,

My experience has been that updating the app only updates the app folder - the settings and Documents files remain untouched. So, if you've changed the format of any of these files then you need to version control them so that you can deal with the older format and upgrade as necessary.

If all you have done is add records though, I would have thought this would be fine.

Assuming you are using source control, you can test all this in the simulator:

- Delete the app from the simulator
- Step back to your original version of your app
- Run the app
- Go back to your latest version of your app
- Run the app again

Does the problem now show in simulator?

I use CoreData to store my calculation history steps and I came across this problem if I modified the CoreData store entities and tried to use an old store with new code - CoreData will spot this and assert pretty quickly. During development the solution is easy - delete the CoreData store in the Documents folder of the simulator. The correct solution for app releases is to version control your files. If you don't, you have to force the user to delete the app from their device to delete the files, which is clearly very bad practice.

Best regards,
__________________
Andy, Cambridge Coders Limited, www.cambridgecoders.com
Calcuccino - scientific calculator for the iPhone
CambridgeCoders is offline   Reply With Quote
Old 08-05-2010, 06:13 AM   #5 (permalink)
Registered Member
 
Join Date: Mar 2010
Location: Warwickshire, United Kingdom
Posts: 163
dcjones is on a distinguished road
Default

Hi Andy,

I will put my hands up and say I have never heard of "source control" until now.
I have read up on the subject and implemented it on the project. Thank you for drawing my attention to "source control".

I followed your instructions to the letter and sure enough the issue was replicated in the simulator.

What would you recommend as the next step.

Thanks for your time with this post.
__________________
Many thanks, keep safe and well.



Dereck
dcjones is offline   Reply With Quote
Old 08-05-2010, 06:33 AM   #6 (permalink)
Registered Member
 
CambridgeCoders's Avatar
 
Join Date: Jul 2010
Location: Cambridge, UK
Posts: 73
CambridgeCoders is on a distinguished road
Default

Hi Dereck,

Getting the problem replicated in the simulator is a good step - well done Now you have the problem in the simulator, can you put debug in your code to figure out what's going on? For example, use NSLog() or breakpoints to see what's being read out of your database? Is it what you expect?

Quote:
I will put my hands up and say I have never heard of "source control" until now.
I have read up on the subject and implemented it on the project. Thank you for drawing my attention to "source control".
Off topic I know, but which source control system have you gone for? Git and Subversion are probably the two most popular (I use git myself). Once you have your source in a source control system it's easy to diff between revisions to see what code has changed - makes this much easier to determine the at what point problems have been introduced.

Best regards,
__________________
Andy, Cambridge Coders Limited, www.cambridgecoders.com
Calcuccino - scientific calculator for the iPhone
CambridgeCoders is offline   Reply With Quote
Old 08-05-2010, 11:54 AM   #7 (permalink)
Registered Member
 
Join Date: Mar 2010
Location: Warwickshire, United Kingdom
Posts: 163
dcjones is on a distinguished road
Default

Hi Andy,

Just a catchup to thank you for your help today. I found the error in the SQL table. A new field was added for the update App and was inserted into the table rather than added to the end. This of course through the field index out by a factor of 1.

So when the App ran the Latitude became the longitude the the longitude was assign the content from the next field. The MapKit function was OK with the Lat and assign the Lng with 0.0.

Again, many thanks for your help.

p.s I am using "subversion" for the version control.
__________________
Many thanks, keep safe and well.



Dereck
dcjones is offline   Reply With Quote
Old 08-05-2010, 01:35 PM   #8 (permalink)
Registered Member
 
CambridgeCoders's Avatar
 
Join Date: Jul 2010
Location: Cambridge, UK
Posts: 73
CambridgeCoders is on a distinguished road
Default

Hi Dereck,

That's great to hear

Best regards,
__________________
Andy, Cambridge Coders Limited, www.cambridgecoders.com
Calcuccino - scientific calculator for the iPhone
CambridgeCoders is offline   Reply With Quote
Reply

Bookmarks

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: 319
10 members and 309 guests
alexP, arash5500, gordo26, HemiMG, mediaspree, nobstudio, Objective Zero, Sloshmonster, stanny, Touchmint
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,655
Threads: 94,116
Posts: 402,889
Top Poster: BrianSlick (7,990)
Welcome to our newest member, pungs
Powered by vBadvanced CMPS v3.1.0

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