Monday, July 30, 2012

Use Restkit Object Mapping directly

Restkit has a good object mapping library inside it. However, it's used is integrated with it's loadObject function and not really clear how we can use it directly without going through loadObject. This is useful when we have data we want to map that does not come from loadObject flow.

There's a brief hint on this on Restkit's Object Mapping manual on section Task > Performing a Mapping. It shows how the mapping is called internally.

Here's the clases related to Object Mapping in Restkit :

and here's summary of the steps :
  • create an instance of RKObjectMappingProvider
  • make mappings for each model using RKObjectMapping and add it to the instance of  RKObjectMappingProvider above (using setMapping function)
  • when it's time to do the mapping create RKObjectMapper instance following the "Performing a Mapping" documentation mentioned above




Accessing app content on iOS device or emulator on

When developing iOS app that store data to device, having a direct access to the filesystem will help a lot on debugging. Here's the references of it on Stackoverflow to access them : for device and emulator. Below are the summary :

  • For device, use project organizer on XCode to access device. From the device entry, you can download the filesystem content of the app
  • For emulator, the filesystem reside on : ~/Library/Application Support/iPhone Simulator/[OS version]/Applications/[appGUID]/

Tuesday, July 10, 2012

iThoughts and Freeplane compatibility

I used Freeplane a lot, not just for mindmapping but also for other uses like lists, outlines and notes. So, it's quite useful for me to having it accessible as much as possible. Currently, the best available option to have Freeplane's file  mobile on iPhone and iPad is using iThoughts. It is not perfect and many aspect not translated well between them, but it's usable and good enough for my need for now.

Here is some tips and notes of using iThoughts as "mobile" Freeplane :

  • Turn off "Resolve Auto Attributes" under "Export Options" group in iThoughts. This will map auto/blank attributes on iThoughts to defaults to Freeplane which is better than having to deal with confusing translation of Auto/inherited attributes
  • iThoughts only know edge color, so every node color (text, background, edge) will all translated (flattened to be more exact) to edge color on iThougts. The bad thing about this is that it's a lossy translation, so when you re-open on Freeplane, all node-related color are back to default except for the edge color
  • Icons compatibility is quite limited. Some typical groups and sequences like flags and numbers are in-sync as some punctuation-based icon like question and exclamation icon is in-sync too. So, use icon sparingly and test for compatibility
  • Even after yo have established your personal convention you might still see some surprises on maps/nodes. This usually some Auto format issue. Try to reset the format to Auto on iThoughts and/or Default in Freeplane and reapply the needed formatting. This usually get the format in-sync again
iThoughts is a good app in itself, but it's Freeplane compatibility it's just medium level. Although it would be ideal to have full Freeplane  app but with some tweaks above  iThoughts could do the job for now.