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; [...]