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.

UIView with shadow, rounded corners and custom drawRect

I have to create a custom UIView that will have round corners, a border, a shadow and its drawRect() method …

ios objective-c uiview swift drawrect
UITableView set to static cells. Is it possible to hide some of the cells programmatically?

UITableView set to static cells. Is it possible to hide some of the cells programmatically?

ios objective-c uitableview
Remove all constraints affecting a UIView

I have a UIView which is placed on the screen via several constraints. Some of the constraints are owned by …

ios objective-c uiview constraints autolayout
How Do I Take a Screen Shot of a UIView?

I am wondering how my iPhone app can take a screen shot of a specific UIView as a UIImage. I …

ios objective-c uiview screenshot
How to enable back/left swipe gesture in UINavigationController after setting leftBarButtonItem?

I got the opposite issue from here. By default in iOS7, back swipe gesture of UINavigationController's stack could pop the …

ios objective-c uinavigationcontroller uinavigationbar uinavigationitem
EXC_BAD_INSTRUCTION (code=EXC_I386_INVOP, subcode=0x0) on dispatch_semaphore_dispose

I am getting EXC_BAD_INSTRUCTION (code=EXC_I386_INVOP, subcode=0x0) on dispatch_semaphore_dispose but don't really know …

ios objective-c exception grand-central-dispatch
Remove all whitespaces from NSString

I've been trying to get rid of the white spaces in an NSString, but none of the methods I've tried …

objective-c string cocoa nsstring
What is the significance of #pragma marks? Why do we need #pragma marks?

What is the purpose of #pragma marks in Xcode? Does their location in .m files matter? Should some #pragma come …

objective-c xcode pragma
UILabel with text of two different colors

I want to display a string like this in a UILabel: There are 5 results. Where the number 5 is red in …

ios objective-c swift uilabel textcolor
How to log a method's execution time exactly in milliseconds?

Is there a way to determine how much time a method needs to execute (in milliseconds)?

ios objective-c optimization time