Apple iPhone: Create a custom toggle button

Friday, December 4, 2009

States UIControlStateSelected or UIControlStateHighlighted not work when a UIButton is set to work UIButtonTypeCustom! Or rather, do not work (because reserved for other types of buttons), for example to create a button in two states: toggle note. If we have created two images (stato1.png and stato2.png) for our button, we can proceed in this [...]

Objective-C: NSLog () on C struct

Thursday, October 29, 2009

Syntax NSLog (@"%@", ...) works and is used to obtain information about objects, but does not work on C data types like struct CGRect or CGPoint, for example. To realize NSLog (@"%@", ...), also on struct type C can rely on conversion functions as NSStringFromCGRect () or NSStringFromCGPoint: PLAIN TEXT Objective-C: CGrect mioRect = (CGRect) (10, 20,30,40); CGPoint mioPoint [...]

Objective-C: an alternative to the use of CGRectMake

Monday, July 27, 2009

CGRectMake () is a function (in reality an inline # define) used a lot especially when you create objects from code or graphical user interface. Its use is therefore often linked UIKit initialization of components, but also to simple UIView or UIImageView. CGRectMake () returns a struct (structure type) CGRect: PLAIN TEXT Objective-C: CGRect struct (CGPoint origin; [...]