iphone
Getting cursor position in a UITextView on the iPhone?
Like drewh said, you can use UITextView’s selectedRange to return the insertion point. The length of this range is always zero. The example below shows how to it. NSString *contentsToAdd = @”some string”; NSRange cursorPosition = [tf selectedRange]; NSMutableString *tfContent = [[NSMutableString alloc] initWithString:[tf text]]; [tfContent insertString:contentsToAdd atIndex:cursorPosition.location]; [theTextField setText:tfContent]; [tfContent release];
Remove Badge from tabbar item
Try doing it via the viewController: UIViewController *viewController = [appDelegate.tabBarController.viewControllers objectAtIndex:2]; viewController.tabBarItem.badgeValue = nil;
problem using tel: URL to initiate a call
The iphone will dial a number using either of the formats listed below. But, it will do nothing if you are in the simulator. It took me 30 minutes of banging my head to figure this out. [[UIApplication sharedApplication] openURL:[NSURL URLWithString:@”tel://15415551234″]]; [[UIApplication sharedApplication] openURL:[NSURL URLWithString:@”tel:15415551234″]]; [[UIApplication sharedApplication] openURL:[NSURL URLWithString:@”tel:1-541-555-1234″]]; Link for Apple documentation on the … Read more
In-House App disappears after installation
I experienced the same problem with one of my in-house apps. The reason was that bundle ID in application manifest was specified incorrectly. After I fixed bundle ID, the application installs normally.
GLKView set drawable properties
If you want to get kEAGLDrawablePropertyRetainedBacking in a GLKView, add the following category to your project. @interface CAEAGLLayer (Retained) @end @implementation CAEAGLLayer (Retained) – (NSDictionary*) drawableProperties { return @{kEAGLDrawablePropertyRetainedBacking : @(YES)}; } @end Setting the drawableProperties on the CAEAGLLayer maintained by the GLKView doesn’t work because the GLKView overwrites those properties when it binds its … Read more
Is there an iPhone equivalent to the NSTokenField control?
Venmo just open sourced their token field. https://github.com/venmo/VENTokenField.git