Top "Objective-c" questions

This tag should be used only on questions that are about Objective-C features or depend on code in the language.

Send and receive messages through NSNotificationCenter in Objective-C?

I am attempting to send and receive messages through NSNotificationCenter in Objective-C. However, I haven't been able to find any …

ios objective-c nsnotificationcenter
Placeholder in UITextView

My application uses an UITextView. Now I want the UITextView to have a placeholder similar to the one you can …

ios objective-c cocoa-touch uitextview placeholder
How do I create delegates in Objective-C?

I know how delegates work, and I know how I can use them. But how do I create them?

ios objective-c cocoa callback delegates
UITextField text change event

How can I detect any text changes in a textField? The delegate method shouldChangeCharactersInRange works for something, but it did …

ios objective-c swift event-handling uitextfielddelegate
How do you trigger a block after a delay, like -performSelector:withObject:afterDelay:?

Is there a way to call a block with a primitive parameter after a delay, like using performSelector:withObject:afterDelay: …

ios objective-c grand-central-dispatch objective-c-blocks
How do I iterate over an NSArray?

I'm looking for the standard idiom to iterate over an NSArray. My code needs to be suitable for OS X 10.4+.

objective-c cocoa iteration nsarray enumeration
How to add a touch event to a UIView?

How do I add a touch event to a UIView? I try: UIView *headerView = [[[UIView alloc] initWithFrame:CGRectMake(0, 0, tableView.bounds.…

ios objective-c events uiview touch
What does the question mark and the colon (?: ternary operator) mean in objective-c?

What does this line of code mean? label.frame = (inPseudoEditMode) ? kLabelIndentedRect : kLabelRect; The ? and : confuse me.

objective-c c syntax operators conditional-operator
How to scale a UIImageView proportionally?

I have a UIImageView and the objective is to scale it down proportionally by giving it either a height or …

objective-c cocoa-touch
How can I disable ARC for a single file in a project?

I am using ARC successfully in my project. However, I have encountered a few files (e.g., in unit tests …

objective-c xcode automatic-ref-counting manual-retain-release