Category "objective-c"

Strange behavior with cursor position while deleting with libPhoneNumber-iOS

I using library libPhoneNumber-iOS for formatting phone numbers in my app. When I deleting text from the end of the text field, all works fine, but if the cu

Round only 2 corners of a UIView in custom UITableViewCell - iOS

I have a UIView in a custom UITableViewCell and I want to round just bottom Left and Right corners of that view. I'm doing the following, but it's not working:

I want to move placeholder text while typing the text in Textfield

I used the following code UITextField *email =[[UITextField alloc]initWithFrame:CGRectMake(48, 330, 330, 50)]; UITextField *password =[[UITextField alloc]initWi

Cannot execute method in an NSPanel from a separate NSWindow in Objective-C

I have a MacOS Objective-C project with a parent NSWindow and an NSPanel containing a TableView whose delegate and data source is a class called TableController

UICollectionView display 3 items per row

I have a UICollectionView created from storyboard, I want to have 3 items per row in the view. I managed to do that using the following: - (CGSize)collect

Why SCNPhysicsBody resets position when set eulerAngles?

I'm trying to use SceneKit to develop a game for tvOS, and I'm having an issue. When I set the node's eulerAngle before apply an impulse to the physicsBody the

UIAlertController Unable to satisfy constraints

I am converting all my UIActionSheet and UIAlertView with UIAlertController. My problem is when I try to present a UIAlertController of style ActionSheet. Here

How to remove the top and bottom padding of UIButton, when create it using auto layout?

When create UIButton with auto layout, the intrinsicContentSize always contain different top/bottom padding according to different text font size. I try to set

SceneKit : how to get distance between two SCNNode ? (ObjC and Swift)

I wonder how to get distance between two SCNNode (ObjC and Swift) Thanks

auto layout modify multiplier of constraint programmatically

How can I modify the multiplier of a constraint programmatically? I have set the following: [self.view addConstraint:[NSLayoutConstraint constraintWithItem:_bu

Build error integrating Clevertap to a Reactnative Application

I'm trying to integrate clevertap with native react and when I include "use_frameworks!" in cocoa pods to be able to use #import <CleverTapReact / CleverTa

Keychain access control from the app with different names

I am using keychain in my macOS app to store jwt tokens (access and refresh)(kSecClassGenericPassword) and I have figure out that I can't manage existed data vi

Set text in uicollectionviewcell

I have created a UIcollectionView and an array with some strings @[@"Item One", "Item Two", @"Item Three"]; In Tableview I would do this: NSString *object = s

Keychain access control from the app with different names

I am using keychain in my macOS app to store jwt tokens (access and refresh)(kSecClassGenericPassword) and I have figure out that I can't manage existed data vi

iOS: Recieveing a crash NSInvalidArgumentException NSConcreteMutableAttributedString addAttribute:value:range:: nil value

This is the line that the error is occurring on. [self addAttribute:(__bridge NSString*)kCTForegroundColorAttributeName value:(__bridge id)color.CGColor range

How to save a color in NSUserDefaults in swift?

I have a litle problem with saving a color in NSUserDefaults . In objective-c is easy : -(NSColor *)colorForKey:(NSString *)key{ NSData *data; NSColor *color

Get class name of UIViewController in swift

How do you get the class name of a UIViewController class in Swift? In Objective-C, we can do something like this: self.appDelegate = (shAppDelegate *)[[UIAppli

Center NSTextAttachment image next to single line UILabel

I'd like to append an NSTextAttachment image to my attributed string and have it centered vertically. I've used the following code to create my string: NSMuta

CLLocationManager startUpdatingLocation not calling locationManager:didUpdateLocations: or locationManager:didFailWithError:

I'm trying to use the CLLocationManager framework in my iOS project to access the user's location but when I call [locationManager startUpdatingLocation] ne

How to step over objc_msgSend function in lldb?

In objective-c, function cal is translated to objc_msgSend. e.g. [foo doSomething:@"keke"] is translated to objc_msgSend(foo, "doSomething:", @"keke") How