agi18n agimagechecker amazonaws android arc autolayout blog building cache calabash certificates clean code cocoa cocoapods data binding debugging deployment target drm ebs ec2 errors facebook fix git i18n images instruments interface builder ios iosx enterpise summit ipad iphone iphone5 kotlin libraries like button linking links llvm memory management method swizzling mobile model mvc mvvm nil objective-c optimizations patch patterns performance presentation provisioning profiles restkit runtime rxjava rxswift security shadows streaming svn swift testing tools tutorials uikit uistackview video view xcode

Subscribe to this blog

Tag: xcode

ARC (III) - ARC Optimizations

Angel G. Olloqui 02 November, 2012

In my previous two posts about ARC (post I and post II) I have talked about the optimizations and how ARC can perform as fast (or even faster) as manual memory management. This is quite clear when working with simple alloc/retain/release examples because it is exactly equivalent to manual memory management but using C calls (which are faster). However, I haven’t explain how it does it when dealing with methods that return autoreleased memory. So, it is time to have some fun.
First, lets copy again the resulting ARC compiled code seen in the first post:

Tags: arc, memory management, objective-c, xcode, optimizations


ARC (II) - Advantages, drawbacks and false myths

Angel G. Olloqui 26 October, 2012

In my previous post I analyzed the fundamentals of ARC. Today, I am going to write a quick post about some general advantages, problems and myths around it. I warn you that I will not enter in details, but it will be useful as an introduction to the next (and probably last) post of the series. 


There are many advantages of using it, but I would summarize them on the following:
  • It Keeps it Simple Stupid (KISS)! Working with ARC makes your code easier to write, read and maintain. Therefore, your code will be less error prone and you could actually save some time writing (specially in dealloc methods).
  • Safer: Do you think your code is secure without ARC? Yes, you know how to retain your instance variables, but, let me ask you if you always retain your temporal variables. Probably not always, right? In the end, if it is a temporal variable there is little point on retaining a variable and releasing it a few lines later right? Well, then check out the last example exposed in my previous post! You can never be absolutely sure if an autoreleased returned value will be available the full variable life time, so you should retain always autoreleased variables to be 100% sure it will work. ARC variables by default are strong, which means that they will be retained, and the compiler never forgets :). Besides that, the introduction of weak references can also help a lot in solving problems with released pointed objects (usually delegates).
  • Less leaks: If you are a master of iOS development you probably have few memory leaks or even not at all. However, even if that is the case is common to work with different people who might not be as experienced as you are. The use of ARC ensures that there is no leak due to an incorrect use of retain/release. However, be careful with the memory retain cycles! they are still there. 
  • Reduces autorelease pools: This one is pretty interesting because I thought that ARC would make heavy use of autoreleasing pools. However, that’s part of a false myth and we will take a look to it later. For now, all you need to know is that it actually reduces the amount of autoreleases in your code (if everything is ARC compatible though), which could make your apps to actually execute faster if your code produces heavy memory pools.

Tags: arc, memory management, objective-c, xcode


ARC (I) - Introduction to ARC and how it works internally

Angel G. Olloqui 11 October, 2012

It has been about a year since Apple released ARC, and even if there is a lot of good information out there I still see some misconceptions, false myths and reluctances to adopt it . Because of that, I am going to write a set of posts about it, but focusing in explaining how it works under the hood and why some of the myths out there are not really true.
So today, lets start by presenting ARC.

Tags: arc, memory management, objective-c, xcode


Advance debugging in XCode

Angel G. Olloqui 02 June, 2012

Today I am going to talk about advanced debugging techniques in XCode. I am not going to spend much time on explaining the different options that you can find in the IDE, how to set breakpoints, or stuff like that. You can find basic techniques in many resources on the Internet.
But before starting, I want to remark two things:
  • This is a real example, where the standard breakpoints and console outputs are not enough to detect where the bug is. I haven’t activated the Exception Breakpoint because this option sometimes destroys the only information we have of the stack trace. My suggestion is to give it a try, but if you can not find your bug with it then disable it and continue reading this post. You will find a different way of debuging and you need as much information as possible. 

  • There are many debugging techniques. Do not blame me if I am doing something in a way slightly more difficult or different to “your way”. It is not a guide of how to do it right, but how to get the information we need in some easy steps.
So, having said that, let's start!

Tags: xcode, debugging, tutorials, llvm


Desarrollar para iPhone/iPad: ¿Qué necesito y por dónde empiezo?

Angel G. Olloqui 02 July, 2010

Voy a empezar a escribir en este blog sobre iPhone/iPad, y como no puede ser de otra forma, empezaré por el principio: ¿Qué necesito y por dónde empiezo a programar para iPhone/iPad?

Vamos allá, pero aviso que no entraré en ningún detalle técnico todavía.

Tags: ios, ipad, iphone, provisioning profiles, certificates, xcode, instruments