Category "objective-c"

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

Constrain mouse movement to region in OS X without jitter

I would like to constrain mouse movement to a specific rectangular region of the screen in OS X 10.11. I modified some code from MouseTools (below) to do this b

Move the annotation on Map like Uber iOS application

I am working on a project where I need to create a similar iOS application to UBER and OLA where the car is moving based on the location. I'm looking for some k

CABasicAnimation to make NSView flip

I'm making a card game for mac and I'm using a CABasicAnimation to making the card flip around. It's almost working, but it could be a bit better. As it works

How can I find out if an SKTexture is the placeholder image

In SpriteKit, if you load an image with the [SKTexture textureWithImageNamed:] method, it will first search your bundles, then atlases, if it fails to find your

ScrollView contentOffset reset after pushViewController

I'm experiencing a problem with ScrollView, my scrollView has 640 of width, from 0 to 320 it's a mapView, from 320 to 640 it's a tableView. I have a segmentedBu

Error: CUICatalog: Invalid asset name supplied: (null), or invalid scale factor : 2.000000

TableViewApplication[1458:70b] CUICatalog: Invalid asset name supplied: (null), or invalid scale factor: 2.000000 Getting this warning while working with Ta

Change the size of UILabel or the font to fit in Accented Character

I have a UILabel with Text inside it called : self.textLabel; Now, I noticed that whenever I added an accented letter like Ä Ö Ü, then I get

Proper way to check if a sub view is outside of the content size of its parent UIScrollView

I have an app that has a UIScrollView with an array of thumbnails for videos. When you touch the thumbnail, the thumbnail begins playing the video. However, whe

CoreData valueForKey issue on Xcode 13

I have an issue in a client's app where calls to valueForKey: on an NSManagedObject subclass are failing for particular CoreData properties when the app is buil

Background alpha transition while scrolling

In a page I am using a scroll view to show two views. For scrolling to each view I have to change the Background alpha in different manner (Or I have to show di

Firebase CocoaPods Installation Not Working

I'm trying to install Firebase via CocoaPods for my Objective-C iOS Application. My Podfile is as follows: target 'RandomName' do pod 'Firebase/Core' pod 'Fire

AVPlayer and AVFoundationErrorDomain Code=-11819

i am developing an app where the music is played via AVPlayer using songs from a cloud service. everything works fine and most of the files are playing without

Undefined symbol: _OBJC_CLASS_$_FIRApp

I m trying to add Firebase Analytic and Firebase Crashlytics using Swift package manager here is a link of git for firebase SDKhttps://github.com/firebase/fireb

CGDisplayIOServicePort is deprecated in OS X >= 10.9, how to replace?

I did small app to allow quickly change screen resolutions on multiple monitors. I want to show product name as title of the monitor, and it's very simple to fi