Archive for category: iPhone

[HOW-TO] Activate next UITextField in UITableView (iOS)

[HOW-TO] Activate next UITextField in UITableView (iOS)

 
57 Kudos
Don't
move!

Update: After that Matteo pointed out the fact that I had everything to be able to access to each UITableViewCell’s instances, I decided to update this blogpost accordingly.

One of the most convenient automations that a developer should build into his applications is the capability of moving to the next (text)fields in a form.

Unfortunately, this automation is not eased by Apple in its frameworks and, thus, require the developer to provide an extra-effort on his side to make this to happen.

February 8, 2013 5 comments Read More
Fix the iOS 6 text shortcuts bug

Fix the iOS 6 text shortcuts bug

 
14 Kudos
Don't
move!

After upgrading to iOS 6 I noticed that text shortcuts weren’t working as before.
Actually, the entire text prediction and spellchecker were working in a different manner. While for this latter there’s no turning back, I managed to find a solution for the first issue.

In order to get the text shortcuts back you need to hard-reboot your phone. In order to do so, press the Home button and while keeping it pressed, press the stand-by/wake up button. There are only two buttons on the iPhone (if we ignore the volume buttons) so it’s pretty easy. First the Home button, then the Wake up. You won’t
lose anything. It’s pretty much like resetting the PRAM of a Macbook. No data is in harm.

Wait a couple of seconds, the screen becomes black. Just release the buttons and turn the phone back on. This worked for me.

Other solutions I found on the web were about disabling and re-enabling the spellchecker, removing and re-adding one (or all) shortcuts but I didn’t test them since the hard-reboot worked for me.

If you have other suggestions, feel free to comment.

Edit: after a couple of days it seems that the text shortcuts feature is degrading as long as time passes by. Hopefully Apple will fix this upstream in the next firmware upgrade.
In the meanwhile you can always re-perform the hard-reboot as a dirty workaround.

October 1, 2012 0 comments Read More
Automatically update store schema with Core Data

Automatically update store schema with Core Data

 
10 Kudos
Don't
move!

Today I was playing with Core Data technology and I was trying to check whether it is possible to update the store schema according to the changes I made to the entities, relationships and whatever else.

I found out that the important steps are:

  • Use the versioning: before modifying your current schema you should select “Editor -> Add Model Version..”
  • Edit as much as you like
  • Select the new version as the active one
  • Go to your app delegate file and modify the - (NSPersistentStoreCoordinator *) persistentStoreCoordinator method as follows:
    NSURL *url = [applicationFilesDirectory URLByAppendingPathComponent:@"YourApp.storedata"];
        __persistentStoreCoordinator = [[NSPersistentStoreCoordinator alloc] initWithManagedObjectModel:mom];
    
    NSDictionary *options = [NSDictionary dictionaryWithObjectsAndKeys:  
    						 [NSNumber numberWithBool:YES], NSMigratePersistentStoresAutomaticallyOption,  
    						 [NSNumber numberWithBool:YES], NSInferMappingModelAutomaticallyOption, nil];
    
    if (![__persistentStoreCoordinator addPersistentStoreWithType:NSSQLiteStoreType configuration:nil URL:url options:options error:&error]) {
    		// The rest of the code here
    	}
    
    return __persistentStoreCoordinator;
    

    The highlighted lines are the one to be added. Please notice that row 8 needs to be updated with options:options. I only tried it using NSSQLiteStoreType as persistent store type but it should work fine even with NSXMLStoreType.

References:

  1. Working with Core Data: Schema Versioning and Lightweight Migrations
August 17, 2011 3 comments Read More
Free over-the-air distribution

Free over-the-air distribution

 
1 Kudos
Don't
move!

Few days ago, Matteo Kuzeko, pointed out to my attention a web service that easily allows iOS developers to share they own application over-the-air in order to do beta testing: TestFlight

In my previous related post I briefly told you how to do the same all by yourself; with TestFlight the goal is the same but this service brings altogether few interesting features. Practically speaking, you have to build up a Team. The latter is usually composed by the developers and the testers.
With the online control-panel you can invite people by using their email addresses (one at a time) or you can generate an URL to send to all of them an invitation to join the beta testing.

Once your teammates subscribe to the website, they will have to register their devices as well. Once they do that, the developers have to add their device to the list of “compatible” devices. This step is required only the first time you set up the team.

The cool features that TestFlight brings are the instant report of what’s going on in the team (it displays the status of all the teammates and what they did so far) and it sends notifications every time the developers deploy (and hence upload) a new version of the app. This way the mates are automatically notified by the system.

I found it to be very interesting and quite immediate and I will definitively propose it to my team in the next days.

May 1, 2011 0 comments Read More
Synchronize contacts and calendar between Linux, Mac OS X, iPhone and Nokia

Synchronize contacts and calendar between Linux, Mac OS X, iPhone and Nokia

 
10 Kudos
Don't
move!

Yeah!
Are you wondering if there’s a way to do such a thing? Yes, there is.
It’s a bit complicated, but not-so-much complicated, and here’s a definitive solution for your problem.

Let’s start saying that I managed to do that using Google Contacts (this link is a bit messy, you can reach a similar page through gMail’s homepage and by clicking “Contacts” on the left sidebar) and Google Calendar. Of course you’ll need a gMail account otherwise everything explained below won’t work.
Second thing I use a Nokia E52 that’s running Symbian 3rd FP2 that I am sure it supplies a Synchronize application that I can find in MenuControl panelPhoneSynchronization (this is a bare translation from Italian, that’s my native language: MenuPannello di controlloTelefonoSincronizzazione.
Third requirement is an account on Goosync. It’s completely free and you need to do that only if you’re going to sync the calendar. Yeah, you got it right: you don’t need Goosync if you’re going to sync only your contacts.

Well, I think we are all set: let’s start configuring those.

First of all make sure you have a backup of your contacts/agenda. That’s important because it’s aleatory the fact that the data are going to be pulled from the server rather than pushed. If the latter occurs, you’re busted.
Once your contacts are ready and set, you can sync those between the system using:

Linux / Mac OS X
Thunderbird: Use Zindus as I wrote in my previous blogpost
Mutt: Use Goobook

Mac OS X
Mail: Open the Address Book application and, in preferences, set to sync your account data using a Google account

iPhone
Just sync it with iTunes. Unfortunately I don’t know if there’s a “mobile” solution, never dug too much into it.

Nokia
Open the Synchronization application I reported above. Create a new profile and name it as you like, let’s say Google.
Then issue the following parameters:

  • Server version: 1.2
  • Server ID: Google
  • Data transport type: Internet
  • Network connection: As you wish (you can use WiFi or 3g, it’s up to you).
  • Host address: https://m.google.com/syncml
  • Port: 443
  • Username: your_gmail_account_@_gmail_dot_com
  • Password: I think you know that
  • Sync type: Both ways

Than, in address book settings (inside the application, don’t quit it), choose

  • Phone database: C:Contacts.db (but before modifying it please have a test with the default setting)
  • Address book database: contacts

Please double check your settings and make sure that you’ve entered then as I wrote: they are case-sensitive

Once your settings are working, please be aware of the following thing: sync works both ways but it’s not 100% reliable. In fact, sometimes, might happen that you delete a contact, it reappears because you had it in your address book on some old machine and then you have to delete that again. Or it may happen that there are conflicts you have to fix.
It’s not to scare the hell out of you, it’s just to say that it’s better if you keep a backup somewhere safe before doing invasive operation on those.

That’s fine, let’s move forward to the Calendar.

It works like the previous one, except that I haven’t tried to find a solution on Linux, yet.
So, let’s signup to Goosync and, if you follow the instructions on their site, you don’t need to issue the following stuff: it’s enough for you to switch profile to the new Goosync.com (in the same Synchronization application).
However, for the manual kind-of-guy (like me), create a new profile and name it as you like.
Enter the following parameters:

  • Server version: 1.2
  • Server ID: SyncWiseEnterprise
  • Data transport type: Internet
  • Network connection: As you wish (you can use WiFi or 3g, it’s up to you).
  • Host address: http://sync2.goosync.com
  • Port: 80
  • Username: your_goosync_username_here
  • Password: your_password_on_goosync
  • Sync type: Both ways

and, again, go to the Calendar settings and set the database to Calendar.

For what concerns Mac OS X, it’s enough for you to use iCal and, in the preferences, create an account and point it to the Google Calendar account. Make sure you deselect all the local calendars or you’re going to freak out.
iPhone applies to the same rule aforementioned: use iTunes and sync everything with it.

As you have might already understand, the limits given by this solution are:

  • You have to manually sync the data on the phone: good for people that don’t want the phone to start sending data while they’re outside, bad for people that commit a lot of changes to their contact’s list or have tons of appointments.
  • You have to manually switch between the two profiles: pain in the ass for the same above reasons. Of course you can buy a Premium account at Goosync website and then you can share contacts and calendar using the same profile.
September 7, 2010 0 comments Read More