Questions tagged [class-extensions]
102 questions
0
votes
1 answer
xCode6 iOS8 how to create a file with an extension for an existing class?
if I remember correctly, in xCode 5 and below, the "New File" option for project navigator included a template to create an extension for an existing class. This option was next to "Cocoa Touch Class" and allowed to enter a base class name. The…

Alex Stone
- 46,408
- 55
- 231
- 407
0
votes
1 answer
Simple Class Extension / Inheritance Clarification
I've been writing Objective-C for a few years now, and decided to go back and learn the very basics to help me write even better code. I'm trying to learn all about instance variables, inheritance and class extensions. I've been reading up on all…

Henry F
- 4,960
- 11
- 55
- 98
0
votes
1 answer
Objective C class extensions- how to overwrite readonly with readwrite method?
I am having trouble understanding how to overwrite a readonly method with a readwrite method written in a class extension. I have a readonly method in my header file, and in my implementation file I try to overwrite this by using a class extension.…

mepstein1218
- 331
- 5
- 14
0
votes
2 answers
What class should I extend, AcionBar or ActionBarImpl?
I feel this is a basic question wiht some trick.
I want to extend the functionality of ActionBar, upon looking up the ActionBar code it turns out ActionBar is an abstract class and the real instantiated class is ActionBarImpl.
This pattern of having…

ilomambo
- 8,290
- 12
- 57
- 106
0
votes
2 answers
Creating class extension for a Class's private methods
I have created a Game Model as a class. I checked out this question about creating a class extension: Best way to define private methods for a class in Objective-C
What I have is some public methods - these are open for other VCs to use in the…

StuartM
- 6,743
- 18
- 84
- 160
0
votes
3 answers
Class Extension vs Header file
What exactly are class extensions and header files? What are the differences? What is the difference between declaring a property/method in a header file vs in a class extension. I am completely new to objective-c so beginner terminology would be…

golddove
- 1,165
- 2
- 14
- 32
0
votes
2 answers
NSString+Extension warning when creating a NSMutableString from self
in an iphone application I created and extension class to the NSString.
NSString+Extensions.m class
In one of the methods I need to convert the string to NSMutableString.
I tried to use this:
NSMutableString * stringToManipulate = [NSMutableString…

Y2theZ
- 10,162
- 38
- 131
- 200
0
votes
1 answer
How to include all lib folder?
I want to extend core Array class with simple method:
class Array
def to_hash
result = Hash.new
self.each { |a| result[a] = '' }
result
end
end
I put array.rb into lib/core_ext and tried to require it in application.rb…

freemanoid
- 14,592
- 6
- 54
- 77
0
votes
1 answer
Dotfuscator WP7 edition and EnumExtention: Friendship did not work
In our application, we have an extension for Enum
namespace System
{
///
/// Contains extention methods for emuns.
///
public static class EnumExtention
{
///
/// Check is value has…
-1
votes
1 answer
try catch block in c++ class ussage
this is v1 which results in errors
#include
#include "exceptionHandlingV2.h"
using namespace std;
int main() {
exceptionHandlingV2 ob(4,0);
cout<

solo
- 25
- 6
-1
votes
4 answers
Having trouble with class extension in Objective C, mac OS. Getting error 'NSInvalidArgumentException', no visible @interface declares the selector
I'm working on exercise 3 on page 76 in Apple's developer pdf in the class categories and extensions section, "Programming with Objective C", found here:…

mepstein1218
- 331
- 5
- 14
-2
votes
1 answer
Is there a way to make an extension for a generic type object?
so I'm trying to make an exception to map my C# class to an proto object via extension methods it doesn't seem to accept a generic type for "this"?
public static ResponseReply ToProtoObject(this Response reply) {
ResponseReply answer =…

Jonas Van mullem
- 33
- 6