useful xcode debugging methodologies

developing for the iponhe is not a simple thing. cocoa is designed with specific patterns in mind, a dominant model-view-controller, performance oriented with specific ways of going about things. xcode is your best friend, believe it or not. the apple documentation is there for you as well, and many hours were spent to create coherent manuals that will assist us in doing a great job. and doing a great job is a must, because mobile devices are not as browsers. memory foot print is really important. if you over due it, your app will be removed by the OS and UX breaks. bad karma indeed.

dealing with memory leaks and zombies is an important issue, and below i will provide a couple of useful tips to setting up xcode in such a way, and arranging your code, so you have more control and understanding of what’s going on under the hood.

first up, i assume you are familiar with:

– reading a call stack
– play around with the expression window
– use the memory browser when needed

if you are not, you probably should read up on those and play around with them. very useful tools to get the gist of what is going on with your app.

tip #1:
– always archive your dSYM (short for debug symbols) along with the app you send for your QA guys (the “testers”). this is really useful, as once they email you back crash logs (which they will), the data in the log will actually make sense, i.e. the symbols are mapped correctly and you will see actual method names rather than HEX addresses.

tip #2:
use the symbolicatecrash script and pass it the .crash file and .dSYM file. this will allow you to mesh the two together and review what had happened. from the command line, execute ‘find /Developer/ -iname symbolicatecrash’. grab the path and add it to your ~/.profile (if you are a bash kind of a guy). add this line: “PATH=/Developer/Platforms/iPhoneOS.platform/Developer/Library/PrivateFrameworks/DTDeviceKit.framework/ \
Versions/A/Resources/:$PATH” and don’t forget to “source ~/.profile” before you try and access the script.

tip #3:
enable malloc_error_break so xcode will halt when you double release an object or release a stomped memory. this directive for the debugger is actually a breakpoint. think about it, what we are asking xocde to do, is break on a memory allocation error as if it were a breakpoint (rather than crashing). this is very useful as the program will halt on the line of code that tried to perform the illegal action. add this to your project from the breakpoint view. easy as pie.

tip #4:
party with the zombies. edit your schema (xcode4 people can you hear me?) and add NSZombieEnabled = YES to the “environment variables” list. what happes here is fun. xcode will not release your objects when their reference count is zero, but will keep them for safekeep within the framework of the app. if any of the pseudo released objects is being sent a method, xcode will halt your application, load the debugger and point you to the line of code that tried to access what is suppose to be a zombie. how cool is that? caution! this method is a heavy memory foot print so take it under consideration when you enable them zombies to roam your lands.

on my next post i will show you a nifty header file that allows for fast turning on and off of debug calls from within your app.

good luck!

top picks for 2010 from the appStore

2010 has been an incredible year for the mobile space, and as crazy as things may appear, this is only the beginning. with the advent move of the smart TVs and slated devices, we are bound to see more innovation for both corporates and consumers alike.


here is my short list of top apps for the iphone first, at random order:

VOIP:
skype: veteran at it’s field. skype is affecting the bottom line by saving money. $3/month for unlimited calls in the US, the ability to work over 3g and soon facetime is where the industry will be, no matter how much carriers want to extort the end users. bar none, skype is keeping us all connected. with PBX integration and a future IPO this company will continue to dominate and lead the way in it’s field.

SOCIAL:
facebook: this facebook app is a fantastic example of how apps can pack zest with style. this is the top used app because it’s well done. nothing much to say, we are all on it and loving it.

foursquare: i am a big fan of the NY based company. real time, location based (and soon NFC), 4squre has started something great that is echoing throughout. mayorships, badges and a solid business plan. i hope for more goodness from these guys.

PHOTOGRAPHY:
fotomecha: probably my favorite camera app (for still photos) in the appStore, because it allows me to be creative and capture moments i.e. more than one moment, and create a flow in time.

itimelapse: for video capable iphones, this app allows timelaps video creation with some nifty features for creative control. you need to be patient and stable, or maybe you need the glif.

MUSIC:
FiRe: top recorder which integrates well with soundcloud. i use it often to record music,conversations etc. these guys are fantastic with performance and know the audio frameworks well. money well spent.

SPL meter: i use this app to know when the sound around me is affecting my hearing. hearing gone bad cannot be regained. those tiny hairs in the hearing tube will not grow back. sounds particular and you may call me old fashioned, but no concert/club in the world is worth loosing our hearing for.

READING:
goodreads: bar none, the top app to sync your pdf files for offline reading. i also sync movies to it and this is the reason i get more done. 30m on the subway is a great time to launch this app (both iphone and ipad). with the ability to sync documents from dropbox, google docs and others, this app packs a punch of useful features.

HOME:
airphones: great little app that turns the iphone into a wireless headset over wifi. you will need to install a server on your mac or windows machine.

mobile mouse: while you have airphones streaming audio from your mac mini, which is hooked up to a 50″ plasma, you will need to launch a browser and go on veetle.com. this app is the best i’ve seen and worth every penny. again, you will need a server running on your machine.

Why Apple TV and Ping will fail

Major snore from Apple in my opinion. I think that the event itself, and the fact it was streamed to Mac machines and Safari browsers only is THE reason why Apple had failed and will continue to fail (in my eyes) with the latest announcements. I am talking about a close eco system and spoon fed experience.

Apple failed with the TV expenditure. Steve did not show us numbers, but clearly it was a failure. The big changes were sizing, pricing of shows and streaming, as opposed to storing. Is that what the users really want? To a certain degree, yes. Users do not want to worry about storage, they want to pay less for a device and for content. Apple did deliver on this, but it will not be enough, I believe, to be a killer device like the iPhone, and take over the living room with a storm. WHY? Because of the closed eco system and spoon fed experience.

Apple did a great job in educating the users and providing a great user experience across the board. I argue that user experience is what Apple is really selling and why people are using it. Coupled with the motivation to challenge and innovate, and you have a winning strategy.

This does not and will not work for the TV because only Apple fanboys will forget everything they know, and start a fresh with Apple TV, and forget all they know and do with their many years of habit. The TV is one area where users do not want to get the Apple filter applied to. Users don’t mind it with their iPod shuffle. They don’t mind it with their Mac OSX based machines, and to a certain degree they agree to it with their iPhone (mainly because Android did not step up it’s UX game to be considered a worthy competitor. yet).

Apple will gain a small market share and will have to come up with something much better than that to capture the imagination of the bigger market. I believe that can be done by turning the Apple TV into a real entertainment center to compete head to head with the Sony PlayStation and the Nintendo Wii as a console, introducing the iOS appStore for the TV. That can be killer. But even that is not enough. An Apple TV can only be better than, let’s say, a Mac Mini hooked up to a TV, if it is open. By open I mean I can do whatever I want to do, as opposed to whatever Jobs wants me to do (buy his content that he chose for me).

Examples for this behavior are ample and sad. Apple removed Camera+ from the AppStore recently because TapX3 released a hack which allows you to fire up the camera from the volume button. Apple initially declined the feature, claiming it will confuse people. So Apple is stepping up to the plate as our parents (more like a big brother), deciding what is confusing for us. Clearly, releasing the shutter speed in an ergonomic way may confuse us. I feel over estimated, and I do not think it is for Apple to decide for me what’s confusing and what’s not.

Apple’s attempt at social media is probably the most interesting news to date from that event. A social network around music, which is mutually exclusive from Facebook. Did I snore yet again? While I do believe this is a GREAT idea and a fantastic opportunity for Apple to increase sales on iTunes – the segregation is peculiar. Even worse – who wants to live inside iTunes? Though revolutionary, iTunes is hate by many. Looks and feels old and clunky. Navigating through your music sucks and discovery with genius is, well, boring…

Apple’s notion that people will have iTunes open to see what their friends are listening to is optimistic at best. Not web based, not facebook integration. Only one hope – it integrates with iTunes on your mobile device. I cannot imagine myself opening up iTunes when I want to listen to some music, and getting up to speed with what’s going on with my music buddies.

Apple can definitely relax a little. Let go of the grip and think of a more open way to provide users what they do best. Or not. My personal opinion is that they will not do that, and continue to thrive with a small market share that pays hefty sums to be a part of the cult.

the next stage for smart phones

no doubt apple revolutionized the smart phones industry. apple gave the market a real shuffle when it introduced it 3 years ago. it was the user experience that made the difference – just like any apple product – from their software to their stores: it’s all about the user experience.

what helped the iphone take off was the community of developers. believe it or not, it is the early hackers who put their time and wits into action, to jailbreak it. jailbreaking means you free the phone from the exclusivity of the appStore, and are able to install apps from other developers (for free or for $$). there are several alternative appStores out there, like cydia and ‘rock your phone’.

why would anyone be interested in installing apps that are not on the appStore? mostly because they extend the capabilities of the device beyond what apple allows or is planning for the time being. for example: tethering. how long did we hear from ATT that tethering is arriving? why can’t we share our internet connection with our laptop and have the iphone serve as a hub? ATT is planning to do so (they claim they are making way for the bandwidth load they are experiencing altogether) for an extra (yes, u heard it right) extra $30 a month. so you pay $30 on your iphone to be constantly online with an unlimited bandwidth (it actually is capped if u check your account page online), and you will pay $30 more to tether.

if you jailbreak your iphone you can install an app called myWi which allows you to tether for a small one time fee of $20. sounds like a good deal right? it is.

another good example is using your data plan as you wish. the internet neutrality act proposes that each and every one of us can use his/hers connection as they please without the internet provider throttling and/or blocking the connections (which happens in spades, though most providers do not admit this). in fact, chile is the first country in the world to anchor network neutrality within it’s constitutional right.

currently ATT does not allow skype calls to be made over the data plan. only wifi. the same goes for ‘face time’ with iphone 4. you can see the other side only if both are over wifi. that pretty much sucks doesn’t it? well, ATT has been putting billions of dollars into infrastructure and i can attest that their signal has gotten better (not much but better) here in NYC. however, i cannot understand what reasons they had (besides greed) to up the data plan cost from $20 on iphone g1 to $30 for the exact same package.

back to business. if you install my3g you can fool the phone into reporting it is over wifi while you are actually over the data network.

want more examples? they are a plenty: sbsettings (allows you to control the phone via a swipe jesture, turn on the phone, the data connection, blue tooth, kill processes and more) proswitcher: allows you to multitaks, meaning putting an app in the background (now partly available in os4) ultrasnow: allows you to unlock the phone, so you can use it with other GSM carriers in the US or over seas (something ATT must provide you by law when traveling abroad – which they don’t). and many many more.

so now back to the title – the next stage of smart phones. well, the title is misleading. it should really read the next stage of smart devices. and that is exactly what they should be: smart devices.

the revolution had already started with the micro sim cards for the ipads. take a device and connect it to the internet – you are golden. forget about minutes, rollovers – all we really have is our data connection. do you want to make a call? launch skype. you can make unlimited calls in the US for $3 a month. face it – a phone is just an application, just like your painting tool or recording device. whatever you want to do will be %100 over the network without extra fees or hidden charges.

and they are all afraid of it because they will loose tons of money right? all the fees on our bill, state charged nickel and dimes for F charge and G cost. the interent scares that scavengers because what will you charge on top of the data plan?

and that is all i really want and the next phone i will get: a device that has the ability to connect to the internet without a phone attached to you. an ipod touch with a micro sim card will do fantastic for me and i will gladly give up my iphone for it.

the future is all about our freedom and ability to connect. it is all about us spending much less (think annually) and getting much much more bang for our buck.

the future of user experience

the world of design and user experience (UX) is shifting along with the world of mobile applications and TV.

in the beginning we had a punch card 🙂 yes, one of those old funky and full of holes punch card. that was the way information was conveyed to the computer. the design drastically evolved to the terminal and what a revolution that was. finally was can SEE what the computer can and we can layer it up with tools. like the command line. quickly the operating system that quickly evolved allowed applications like the terminal to browse files (ls -l anyone?) and much more.

it was apple that came up with the next best thing (they tend to do that…) when they came up with a graphical user interface (GUI) and the windows system, which bill gates and microsoft copied shamelessly (or at least that what is written). that part of history probably most of you can remember. widows 3.11 rocked big time and with the shift of personal computer and IBM we all got to experience the bliss for the low cost required to allow massive growth. apple came out with yet another cool idea – the mouse: a way for us to interact with the screen and the content presented on it. no more keyboard commands that were reserved for the dorky nerdy geeky ones. now we can all interact with the computer in a fashionable way – an extension of our arm that seeps into the computer.

this was huge – and with the availability of an SDK to program applications, every tom, dick and harry were hard at work decoding the win32 API and developing lots and lots of apps for the masses. from music applications to games and file editors. the rest is history my friends.

until the iphone came along and introduced the multi touch to the world. granted – they were not the first to do so, but they were the ones to implement it in a natural way (and i am using the word natural for a reason here…) that we can all interact with. no more mouse ladies and gents. no more a device that will click on the data and we circle it around the screen to get where we want to and interact with it via one/two or 3 buttons.

this new user experience is called “natural user interface” which basically means the content which we see IS the interface. think about it for a second: on your iphone/ipad/android – the photo application you use… you touch the photo, swipe it around, left or right, up or down. double tap it, pinch and rotate and more. the content IS the interface and the experience becomes a better personal experience.

which brings us to the title of this post – the future 🙂 the future is already here and it is called “first person interface”. in a first person interface the INPUT is based on WHERE you are and WHAT and WHO is NEAR you. this is so important to understand – it begs repetition: i “first person interface” the input is based on where you are and what and who is near you.

let’s take an example: take layer. when you launch the app on your mobile device it knows where you, and by capturing the environment with the camera it layers information to your choice onto the screen. pretty sweet 🙂 and there are other great players in that evolving market so check out this list for the iphone.

the new mobile devices (slate and phones) allows access to the following information:
1. location (GPS/WiFi/Cell tower)
2. orientation (compass)
3. position and motion (accelerometer)
4. audio (microphone/speakers)
5. device to device (bluetooth)
6. multitouch (up to 10 simultaneous ones for the iphone OS)
7. push notification (for apple devices)

so to sum it up – the new user experience is the “first person interface” where we navigate the space around us by using our mobile devices, the application augments the reality by layering the real world with data, and we interact with nearby objects (museums, coffee shops etc) and people (twitter friends, family, etc)

more exciting ways to experience the world and interact with it are coming our way, so i’ll wrap it up with a video.