Recent Posts

Showing posts with label Objective-C. Show all posts
Showing posts with label Objective-C. Show all posts

Objective-C: How to make UIText move up when keyboard is visible

With the iPhone SDK: I have a UIView with UITextFields that brings up a keyboard. I need it to be able to: Allow scrolling of the contents of the UIScrollView to see the other text fields once the keyboard is brought up Automatically "jump" (by scrolling up) or shortening I know that I need a UIScrollView. I've tried changing the class of my UIView to a UIScrollView but I'm...

Objective-C: How to check if a string contains another script

To check if a string (NSString) contains another small string this is the code: NSString *string = @"hello bla bla"; if ([string rangeOfString:@"bla"].location == NSNotFound) { NSLog(@"string does not contain bla"); } else { NSLog(@"string contains bla!"); } The key is noticing that rangeOfString: returns an NSRange struct, and the documentation says that it returns the struct {NSNotFound, 0} if...