Tag: cocoa touch

Email validation on textField in iPhone sdk

In iPhone App How to Add Email validation on UITextField? Please Help and Suggest Thanks.

Can I pass a block as a @selector with Objective-C?

Is it possible to pass an Objective-C block for the @selector argument in a UIButton? i.e., Is there any way to get the following to work? [closeOverlayButton addTarget:self action:^ {[anotherIvarLocalToThisMethod removeFromSuperview];} forControlEvents:UIControlEventTouchUpInside]; Thanks

How can I add CGPoint objects to an NSArray the easy way?

I have about 50 CGPoint objects that describe something like a “path”, and I want to add them to an NSArray. It’s going to be a method that will just return the corresponding CGPoint for an given index. I don’t want to create 50 variables like p1 = …; p2 = …, and so on. […]

Cocoa Touch: How To Change UIView's Border Color And Thickness?

I saw in the inspector that I can change the background color, but I’d like to also change the border color and thickness, is this possible? Thanks

Is it possible to disable floating headers in UITableView with UITableViewStylePlain?

I’m using a UITableView to layout content ‘pages’. I’m using the headers of the table view to layout certain images etc. and I’d prefer it if they didn’t float but stayed static as they do when the style is set to UITableViewStyleGrouped. Other then using UITableViewStyleGrouped, is there a way to do this? I’d like […]

Responding to touchesBegan in UIPickerView instead of UIView

I have a UIPickerView that gets faded out to 20% alpha when not in use. I want the user to be able to touch the picker and have it fade back in. I can get it to work if I put a touchesBegan method on the main View, but this only works when the user […]

How to make a superview intercept button touch events?

Say I have this code: #import <UIKit/UIKit.h> @interface MyView : UIView @end @implementation MyView – (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event { // How can I get this to show up even when the button is touched? NSLog(@”%@”, [touches anyObject]); } @end @interface TestViewAppDelegate : NSObject <UIApplicationDelegate> { UIWindow *window; } @end @implementation TestViewAppDelegate – (void)applicationDidFinishLaunching:(UIApplication *)application […]

Can I disable UIPickerView scroll sound?

I want to disable the annoying clicks that the UIPickerView generates upon scrolling up and down. Is there a way to do this? I want to play short sounds for each item that the picker view lands upon. It gets ruined by the built in sound. I understand that the picker sounds can be turned […]

Call instance method from class method

So I need to call some instance methods from class methods in objecitve-c… Example : +(id)barWithFoo:(NSFoo *) { [self foo]; //Raises compiler warning. } -(void)foo { //cool stuff } So my question; StackOverFlow is how do you do such things in Objective-C, I’m new kinda to OOP, so am I mad, or is there a […]

Bootstrap Server Error in Xcode IPHONE

This question already has an answer here: iOS – strange error when testing on simulator 31 answers