Questions tagged [nsobject]

NSObject is the root class of most Objective-C class hierarchies; it has no superclass. From NSObject, other classes inherit a basic interface to the runtime system for the Objective-C language, and its instances obtain their ability to behave as objects.

Although it is not strictly an abstract class, NSObject is virtually one. By itself, an NSObject instance cannot do anything useful beyond being a simple object. To add any attributes and logic specific to the program, you must create one or more classes inheriting from NSObject or from any other class derived from NSObject. NSObject adopts the NSObject protocol. The NSObject protocol allows for multiple root objects. For example, NSProxy, the other root class, does not inherit from NSObject but adopts the NSObject protocol so that it shares a common interface with other Objective-C () objects.

NSObject is the name not only of a class but of a protocol. Both are essential to the definition of an object in Cocoa (). The NSObject protocol specifies the basic programmatic interface required of all root classes in Cocoa. Thus not only the NSObject class adopts the identically named protocol, but the other Cocoa root class, NSProxy, adopts it as well. The NSObject class further specifies the basic programmatic interface for any Cocoa object that is not a proxy object.

The design of Objective-C uses a protocol such as NSObject in the overall definition of Cocoa objects (rather than making the methods of the protocol part of the class interface) to make multiple root classes possible. Each root class shares a common interface, as defined by the protocols they adopt.

More Information : NSObject Class reference

899 questions
-1
votes
2 answers

addObjects to my Model (NSObject Class) NSMutableDictionary

I stuck somewhere. I want to create NSMutableDictionary in my Model Class which name is Data.h & .m and i want to some add some object from my controller. I tried some Methots but i couldnt do it .. there is my model .m file #import…
emresancaktar
  • 1,507
  • 17
  • 25
-1
votes
1 answer

how to load the data from server in viewcontroller IOS

hi I’m trying load data from my online server to view controller but I m getting few issues in that. Using the nsobject and json I’m trying to load in my view controller. I’m stuck with connecting the nsobject to the labels which i have in my…
kumar
  • 117
  • 3
  • 13
-1
votes
2 answers

Passing objects between NSObjects in ios

I want to assign value for NSString *just which is in the Second NSObject from the First NSObject and I want to access the Assigned value from the Viewcontroller. I tried the above code It doesn't work for me. It returns null What i am doing…
AlgoCoder
  • 1,706
  • 5
  • 19
  • 40
-1
votes
2 answers

Creating NSObject with NSArray

I'm trying to create a NSObject class which contains an array which contains the alphabet. When I try to implement the array, I get a warning stating that "Initializer element is not a compile-time constant" I've researched it and it has something…
codercat
  • 22,873
  • 9
  • 61
  • 85
-1
votes
2 answers

Pass data UItable to UItable Via NSObject

Can I pass the data from table to other table via NSObject ? Example: First table send data -(void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender{ NSIndexPath *path = [self.tableView indexPathForSelectedRow]; Data *g = [[Data…
Kana
  • 5
  • 2
-1
votes
1 answer

ios assign self to property in another class

I'm trying to assign self to a property in antoher class (nsobject class) using self as pointer to the view controller but the property is always nil. Any of you knows why or how can I…
HelenaM
  • 1,807
  • 6
  • 30
  • 41
-1
votes
2 answers

how to store classobject that returns self

I am making a NSObjectClass that has a method in it that returns self. This is what it looks like roughtly storageclass.h // storageclass vars go here - (storageclass)assignData:(NSDictionary *)dictionary; storageclass.m //@synthesise…
HurkNburkS
  • 5,492
  • 19
  • 100
  • 183
-1
votes
2 answers

iOS: Passing parsed values from soap webservice in NSObject class back to UIViewController

I don't know why this is being so difficult but I can't get this to work. Here's my simple problem: I have a UIViewController that calls paring class type of NSObject class that does the parsing jobs. I just need the parsed data values to be…
Mr.KLD
  • 2,632
  • 2
  • 16
  • 26
-1
votes
1 answer

How to pass a returning NSMutableArray from a method into a NSMutableArray

I would like to know how to call a method from a NSObjectClass that returns a NSMutableArray and save that returning MutableArray into a NSMutableArray in the calling class. effectively this is how it looks NSObject class has the method with the…
HurkNburkS
  • 5,492
  • 19
  • 100
  • 183
-1
votes
6 answers

Remove certain objects from NSMutableArray

I have an NSMutableArray of objects which are of AdDetail class that hold a few properties (for eg. adId, adTitle, adPrice... etc). I want to remove only those objects which have adID = 0. How can I do that ?
Ankur Arya
  • 4,693
  • 5
  • 29
  • 50
-1
votes
1 answer

NSObject with +(NSArray)

I am creating a NSObject to load the TimeLine twitter Code: + (NSArray *)executeTweetFetch { __block NSArray *fetchedTweets = [NSArray array]; NSURL *getTweetUrl = [NSURL…
Lcstest Test
  • 113
  • 1
  • 2
  • 9
-1
votes
3 answers

NSDictionary with NSObjects as keys

I'm trying to create an NSDictionary that keeps track of calling objects for a function. I'd like to create a unique string for each object without knowing anything about it. My first thought is to use the memory address of the object's pointer, but…
nothappybob
  • 3,097
  • 4
  • 16
  • 15
-2
votes
2 answers

How can i create a my own custom button without using interface builder?

I want to create my own custom button without using any interface builder. Actually i wants to set all my properties/attribute(Like frame,color,size,label etc.) separate in a NSObject class.Then from my UIView class i want to draw them . How can i…
user930195
  • 432
  • 1
  • 5
  • 19
-2
votes
4 answers

why can NSObject class be delegate to UIImagePickerController for instance?

i need explanation of how could NSObject Class be a delegate to any controller although NSObject is not a controller !?
-2
votes
4 answers

Split an NSString

Quick question. I need to split an NSString, if it contains a certain substring. Can someone show me an example of how to do this? // good string string = RESULT: 123.23 // bad string (has no result prefix) string = asldkfjasdlkfj if( string has…
Josh
  • 12,448
  • 10
  • 74
  • 118
1 2 3
59
60