Objective-C: Display frame size with NSLog

Width and height values are CGFloat values. To display them, you need to use the %f formatter from NSLog. But displaying these variables can be quite verbose, see below: NSLog(“frame: %fx%f”, myview.frame.size.width, myview.frame.size.height); Output will show : frame: 320.000000×480.000000 There are two other way to display frame size with NSStringFromCGRect() or [NSValue valueWithCGRect:] : NSLog(“frame: … 

 

Start Developing iOS Apps Today

Apple published a great doc for newcomers. It’s also a good source of links and articles for all the basics in iOS, from enrolling as developer to publish your first app. Find all related docs links below: Tutorial: Your first iOS app Manage your workflow in XCode Write Objective-C code Acquire basic programming skills Survey … 

 

How I upgraded my iPhone 3GS from 3.x to 4.x

When I tried to upgrade my phone 3GS 3.x to a 4.x firmware found on osxdaily.com, I got the famous “this device isn’t eligible for the requested build”. My jailbroken device was on a 3.1.3 firmware with Cydia installed. After trying different 4.x firmwares, I googled this error message and found an interesting thread here. … 

 

Learn iOS Application Development with Stanford

The new Fall 2011 courses from Stanford on iTunes U are available! Courses by Paul Hegardy released with a Creative Commons BY-NC-ND license in full HD. 7 courses are available: MVC and Introduction to Objective-C My first iOS App Objective-C Views Protocols and Gestures Multiple MVCs and Segues iPad Apps

 

Debugging EXC_BAD_ACCESS

A helpful article explaining how to use gdb to debug EXC_BAD_ACCESS: EXC_BAD_ACCESS and no stack trace == more quality time lost in Xcode Also, if you don’t know about NSZombieEnabled you should read the following articles: What is NSZombieEnabled? How do I set NSZombieEnabled in Xcode 4?

 

iOS device and OS version

If you are interested in device class and OS version statistics, I’ve compiled a list of recent articles: iOS device and OS version stats from Instapaper 3.0 2011-03-24 is it worth supporting iOS 3 in 2011? 2011-03-20 What proportion of all iPhone owners use iOS 4.x today? 2011-01-18 61% of iPads already running iOS 4 … 

 

CSSMERR_TP_NOT_TRUSTED with Xcode

After switching to a new MacBook (and copying everything through Firewire cable), I couldn’t compile any app on my iPhone. Compilation was always ending up with the following message: /…/build/Debug-iphoneos/xxxxxx.app: CSSMERR_TP_NOT_TRUSTED Command /usr/bin/codesign failed with exit code 1 I checked my provisioning profiles, certificates and everything and couldn’t find a solution. Finally, while browsing the … 

 

Xcode tips and tricks

Starting or not Mac OS X / iOS development, it’s worth reading articles to find tips that suits you. 10 Xcode power user tips for iPhone devs What are those little Xcode tips & tricks you wish you knew about 2 years ago? 14 Essential Xcode Tips, Tricks and Resources for iPhone Devs Killer Xcode … 

 

Tint UIButton and UIBarButtonItem

Edit 2011-11-04 Since iOS 5.0, UIButton and UIBarButtonItem have a tintColor property.   You may have noticed that the tint property is not available for UIButton and UIBarButtonItem. Two common techniques to change the color, you can find around are drawing button with CoreGraphic or using a stretchable UIImage. Lately, I found a new technique based on …