iPhone – UIActionSheet Example

UIActionSheet is a cool way to get user input. The following example shows you how to implement the UIActionSheet.

1. Extend the UIActionSheetDelegate in the .h header file of the ViewController and add the (IBAction)showActionSheet:(id)sender method. Continue reading iPhone – UIActionSheet Example

iPhone – Disable the Cut/Copy/Paste Menu on UITextField

Update @ 2012-07-11: for ios >= 5.1 canPerformAction:(SEL)action withSender:(id)sender is not working anymore. Please refer to the following post for more information
StackOverflow – How do you REALLY remove Copy from UIMenuController

 

If you want to disable the Cut/Copy/Paste Menu, add the following piece of code in the implementation file of the view controller which containing the UITextField
Continue reading iPhone – Disable the Cut/Copy/Paste Menu on UITextField

Joomla – Disable Email Auto Link

Whenever u have an email address inside a Joomla page, it would be linked automatically.

To disable this feature, log in as administrator.

1. Goes to Mambots -> Site Mambots

2. Unpublish the Email Cloaking Mambot

Done =)

Update @ 2013-05-03: Disabling the plugin ‘Content – Email Cloaking’ under plugin manager could also solve this issue as suggested by Larisa. Thanks Larisa. =D

iPhone – Capture Screenshot Programmatically

Capturing screenshot on iPhone needs the QuartzCore framework.

1. Right click the Framework folder in your Xcode project.

2. Add -< Add Existing Frameworks

3. Choose the QuartzCore.framework Continue reading iPhone – Capture Screenshot Programmatically

iPhone – Set Maximum Length of String in UITextField

There is no maximum length attribute in the UITextField. Here is a work around to limit the number of input characters in an UITextField.

1. Implement the UITextFieldDelegate in the .h header file

...
@interface HelloViewController : UIViewController <UITextFieldDelegate> {
	...
}
@end

 

2. Implement this function in the .m implementation file to set the maximum length to 4 characters

- (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string {
	NSUInteger newLength = [textField.text length] + [string length] - range.length;
	return (newLength > 4) ? NO : YES;
}

 

Done =)

Reference: iPhone SDK: Set Max Character length TextField

Dream BIG and go for it =)