I create a button programmatically………. button = [UIButton buttonWithType:UIButtonTypeRoundedRect]; [button addTarget:self action:@selector(aMethod:) forControlEvents:UIControlEventTouchDown]; [button setTitle:@"Show View" forState:UIControlStateNormal]; button.frame = CGRectMake(80.0, 210.0, 160.0, 40.0);...
I just upgraded to Xcode 4 and for some reason my app won’t run in the simulator or iOS device. It was working perfectly in Xcode 3, but all...
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...
Can someone briefly explain to me how ARC works? I know it’s different from Garbage Collection, but I was just wondering exactly how it worked. Also, if ARC does...
How do I test whether an object is an instance of a particular class in Objective-C? Let’s say I want to see if object a is an instance of...
How can I execute a terminal command (like grep) from my Objective-C Cocoa application? 12 Answers 12
in iOS6 I noticed the new Container View but am not quite sure how to access it’s controller from the containing view. Scenario: I want to access the labels...
In my little iPad app I have a “switch language” function that uses an observer. Every view controller registers itself with my observer during its viewDidLoad:. - (void)viewDidLoad {...
When trying to register for push notifications under iOS 8.x: application.registerForRemoteNotificationTypes(UIRemoteNotificationType.Alert | UIRemoteNotificationType.Badge | UIRemoteNotificationType.Sound) I get the following error: registerForRemoteNotificationTypes: is not supported in iOS 8.0 and later....
How do you set the image for a UIButton in code? I have this: UIButton *btnTwo = [UIButton buttonWithType:UIButtonTypeRoundedRect]; btnTwo.frame = CGRectMake(40, 140, 240, 30); [btnTwo setTitle:@"vc2:v1" forState:UIControlStateNormal]; [btnTwo...