Showing posts with label nsstring. Show all posts
Showing posts with label nsstring. Show all posts

Convert CGPoint, CGRect or CGSize to String


-(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
{
    UITouch *touch = [touches anyObject];
    
    CGPoint previousPoint1 = [touch previousLocationInView:self];
    NSLog(@"touch begin %@", NSStringFromCGPoint(previousPoint1));
}


NSStringFromCGRect(CGRect rect)
NSStringFromCGSize(CGSize size)

Check if string null or not

iPhone SDK Tips & Tricks

if([myStr isEqual: [NSNull null]])
NSLog(@"null");
else
NSLog(@"not null");