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.

Creating a UIImage from a UIColor to use as a background image for UIButton

I'm creating a colored image like this: CGRect rect = CGRectMake(0, 0, 1, 1); UIGraphicsBeginImageContext(rect.size); CGContextRef context = UIGraphicsGetCurrentContext(); CGContextSetFillColorWithColor(context, [[UIColor redColor] …

ios objective-c uibutton uiimage
Understanding NSString comparison

Both the following comparisons evaluate to true: 1) @"foo" == @"foo"; 2) NSString *myString1 = @"foo"; NSString *myString2 = @"foo"; myString1 == myString2; However, there are …

objective-c cocoa nsstring string-comparison
Xcode not automatically creating bridging header?

I imported an Obj-C file into my swift project and Xcode automatically prompted me to create a bridging header file …

ios objective-c swift xcode bridging-header
How to split string into substrings on iOS?

I received an NSString from the server. Now I want to split it into the substring which I need. How …

ios objective-c iphone string substring
How do I get video durations with YouTube API version 3?

I'm using YouTube API v3 to search YouTube. https://developers.google.com/youtube/v3/docs/search As you can see, …

php objective-c rest youtube-api youtube-data-api
Programmatically open Maps app in iOS 6

Previous to iOS 6, opening a URL like this would open the (Google) Maps app: NSURL *url = [NSURL URLWithString:@"http://maps.…

ios objective-c ios6 mapkit
Check play state of AVPlayer

Is there a way to know whether an AVPlayer playback has stalled or reached the end?

ios objective-c iphone avfoundation avplayer
Number of days between two NSDates

How could I determine the number of days between two NSDate values (taking into consideration time as well)? The NSDate …

ios objective-c cocoa-touch nsdate
Setting BOLD font on iOS UILabel

I have assigned a custom font of 'Helvetica' with size 14 already for the text in UILabel using Interface Builder. I …

ios objective-c fonts uifont
How to add Done button to the keyboard?

UPDATE: I also tried implementing UITextViewDelegate delegate and then doing in my controller: - (BOOL)textViewShouldEndEditing:(UITextView *)textView { [textView resignFirstResponder]; …

ios iphone objective-c xcode programmatically-created