objective-c-category Questions

2

Solved

I have created a SPM package with a bunch of old Objective-C code (I want to convert some old code "Objective-C code with a big bridging header" into "Objective-C in some SPM package...

4

Solved

There are two situations, that I am aware of, that cause the following errors: ld: warning: instance method 'resetAudioSystem' in category from /opentok-ios-sdk/Opentok.framework/Opentok(OTPublis...
Novotny asked 12/11, 2013 at 5:35

2

Solved

First of all I have seen that there are many questions about "unrecognized selector sent to instance" issue. I have seen few but saw nothing about accessing a defined in category property... I hav...

6

I was trying to create NSManagedObject subclasses (2 related entities) automatically in Xcode. They are generated like this: However, before I do anything further, when I tried to build and run ...
Toni asked 7/11, 2016 at 7:57

2

Solved

I am revising an early project where I use tags to identify 1-of-5, 1-of-16 or 1-of-10 UIButtons. I want to replace the tags with a customised property based on my understanding of this answer. Th...
Swagman asked 25/5, 2017 at 10:46

2

Solved

I'm using NSMapTable in a number of places in an iOS 6 project, and would like to be able to use the new dictionary subscripting style for accessing objects. (NSMapTable behaves mostly like an NSMu...
Katharynkathe asked 31/10, 2012 at 0:51

1

I have an Obj-C category on NSDate and I am trying to use the functions in that category with Swift's Date structure. Is there a clean way to do that without having to cast every time or having to...
Natasha asked 26/9, 2016 at 14:55

2

Solved

Here is my problem: I use Core Data to store rich text input from iOS and/or OS X apps and would like images pasted into the NSTextView or UITextView to: a) retain their original resolution, and ...
Karelia asked 30/10, 2013 at 0:26

3

Solved

I have installed AFNetworking 2.1.0 with CocoaPods on Xcode 5. //ViewController.h #import <AFNetworking/AFNetworking.h> #import <AFNetworking/UIImageView+AFNetworking.h> Calling setI...
Staciastacie asked 7/2, 2014 at 11:7

2

Solved

I've added an extension to UIColor for some colors that I use throughout my app. Here's an example: extension UIColor { func appLightGrayColor() -> UIColor { return UIColor(red: 190.0/255.0, ...
Santo asked 23/6, 2014 at 22:53

3

Solved

I have some swift extensions I want to across projects. I'd like to avoid category pollution though, unless those extensions are requested. Is it possible to write them so that they only apply if...
Dissident asked 29/4, 2016 at 17:32

1

Solved

How do I create a category to an existing Cocoa Touch Class for objective-c in Xcode 7.2? I've been looking for an hour but couldn't find anything helpful.
Erlina asked 3/4, 2016 at 2:4

4

Solved

Class extensions @interface Class () are a lot more powerful and can inject variables into the class. Categories @interface Class (Category) can't. What other differences are there, and when shou...
Socket asked 21/8, 2011 at 3:23

3

Solved

I need to add method to NSURLSessionTask. Here's my category which is supposed to do that: // NSURLSessionTask+Extras.h #import <Foundation/Foundation.h> @interface NSURLSessionTask (Extra...
Venerable asked 27/6, 2014 at 9:53

4

Solved

Can anybody tell me when to use categories and when to use subclassing in Objective-C? Also please tell me the advantages and disadvantages of them.
Shanta asked 9/11, 2011 at 5:47

2

Solved

Short problem description Can I extend UIView with a category, but have it only work on subclasses that implement a specific protocol (WritableView)? I.e. can I do something like the following? ...
Brander asked 19/7, 2013 at 6:38

6

Solved

If I have a method to attach an animation to an UI Element, instead of copy/pasting the code for this method into many viewcontrollers, can I just create one class to hold the method and then impor...
Making asked 15/4, 2014 at 13:39

6

Solved

I have an Objective-C category that I'd like to add to multiple classes without duplicating the code contained in the category. I simply want to add the same methods to multiple classes. I have ex...
Emmaline asked 26/2, 2012 at 4:30

2

Solved

I'm working on a project in Objective-C and I'm facing a situation. Let's say I have a class named Foo. I implement a category for this class named Foo+Bar and override Foo's method fooMethod:. T...
Spindlelegs asked 30/7, 2015 at 7:50

4

Solved

I'm creating a category over NSDate. It has some utility methods, that shouldn't be part of the public interface. How can I make them private? I tend to use the "anonymous category" trick when c...
Permanganate asked 25/6, 2011 at 15:10

3

Solved

I'm new to objective-C, so apologies if this is repeated somewhere. I have a category(?) that is something like: inside SomeClass.h: @interface SomeClass (SomeCategory) <SomeDelegate> @prop...
Zigzag asked 25/8, 2014 at 20:2

5

Solved

I am little confused about some concepts around Objective-C protocols and categories. Can protocols and categories be inherited by subclasses in Objective-C?
Montagna asked 19/9, 2011 at 12:33

2

Solved

I have a category on UIImage that is written in Objective-C. The following are some example methods. How do I call these methods in Swift? +(UIImage *) imageOrPDFNamed:(NSString *)resourceName; +...
Pteridophyte asked 1/8, 2014 at 21:45

2

Solved

I'm writing a library, which will potentially be used by people that aren't me. Let's say I write a class: InterestingClass.h @interface InterestingClass: NSObject - (id)initWithIdentifier:(NSSt...
Gwendolyn asked 31/1, 2013 at 14:10

2

Solved

Consider following situation: Object > MyClass > MyClassA, MyClassB If I want something in the Object level, for example, I added printDetail(); How can I do it in Java implementation? Mor...
Weisburgh asked 14/3, 2012 at 4:21

© 2022 - 2024 — McMap. All rights reserved.