Categories
- Code (3)
- Code Snippets (12)
- git (1)
- Hardware (1)
- News (5)
- Objective-C (6)
- Precompiled (4)
- Programming (1)
- Review (1)
- Swift (9)
- Swift Standard Library (3)
- Tips (3)
- Tutorial (22)
- Uncategorized (3)
- WWDC (1)
-
Recent Posts
Meta
-
Tag Archives: beginner
Handy UIKit Debugging Functions
I don’t know how many times I had typed something like
1 2 3 4 5 |
NSLog(@"self.bounds (%g,%g,%g,%g)" self.bounds.origin.x, self.bounds.origin.y, self.bounds.size.width, self.bounds.size.height); |
before I discovered that UIKit has the following handy string conversions functions
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
NSString* NSStringFromCGAffineTransform ( CGAffineTransform transform); NSString* NSStringFromCGPoint ( CGPoint point); NSString* NSStringFromCGRect( CGRect rect); NSString* NSStringFromCGSize( CGSize size); NSString* NSStringFromUIEdgeInsets( UIEdgeInsets insets); |
Reference UIKit Function Reference
The init
and dealloc
idioms.
For C++ programmers the first surprise waiting for them in Objective-C is that in a derived class they must explicitly call the init and dealloc methods of the superclass (roughly the equivalent of a constructor and destructor). By following the … Continue reading