nsobject

perfomSelector: withObject: afterDelay: can I ask for a low priority?

Is there some way when sending this message to specify that I rather have my selector performed after all pending UI events, if any? Ie. give my aterDelay timer a lower priority in the event queue. ...

How to instantiate an NSObject in the Interface builder .xib file

Greetings, I have a view based application project where I have created an NSObject class called "SquareClass". Now, from the Xcode's interface builder, I want to be able to instantiate that "SquareClass" into a square object with global scope, in such a way that, when I create actions from any UI controls(i.e textboxes, buttons etc...)...

When wouldn't NSObject be stated as the parent class?

For example: @interface Fraction: NSObject { ... When wouldn't NSObject be used and is NSObject the ultimate parent class for all other classes? Please feel free to correct me on any wrong terminology used. ...

Class variable type gets changed

So in my view controller, I run code to populate an NSArray of Customer (custom class) objects. This custom class has objects that are of ANOTHER custom class called Address (a customer has a billing address and a shipping address). In the view controller when a customer in the list is selected, it passes a new view controller a customer...

Trying to grab integer from pre-defined p-list? ObjC/Cocoa

Hello, I'm working on an Objective-C/Cocoa roguelike, because I've always found that working on a game is the best way to learn about a language. I've gotten quite far with my game, but I'm having a problem. Each level.plist is defined with a few things, like so: <key>Save Location</key> <integer>0</integer> It's grabbed like so, I'...

Filling Array with Custom Class - retrieving values...

I have the following code NSMutableArray *leeTemp = [[NSMutableArray alloc] init]; Player* playerLee = [[Player alloc] init]; playerLee.name = [array objectAtIndex:1]; [leeTemp addObject:playerLee]; [playerLee release]; And this generates an array of Players (I think)! When I do the following it shows the addresses of the Players. N...

Capturing all methods/message calls on an object

How do I put a "hook" on an object so I can see what messages are being sent to it? (ie do an NSLog() every time a message is sent to an object). I think recall seeing this done before but I forget how. I am thinking it might help me track down why part of my code is not working. ...

How does inheriting from NSObject work?

There are a couple of things about Objective-C that are confusing to me: Firstly, in the objective-c guide, it is very clear that each class needs to call the init method of its subclass. It's a little bit unclear about whether or not a class that inherits directly from NSObject needs to call its init method. Is this the case? And if...

How do I know if a pointer is an NSObject?

I have a pointer in an objective-C class that I need to send messages to. The pointer can potentially be anything, so I need to make sure that it will respond to my messages before I send them. Here's the function I'm using to do the checking: int delegatePreparedForSelector(id delegate, SEL aSelector) { if (delegate && [deleg...

How to declare a C Array as a property of an Objective-C object?

I'm having trouble declaring a C Array as an Objective-C Property (You know @property, and @synthesize so I can use dot syntax)...Its just a 3 dimensional int array.. ...

Why subclass NSObject?

What is the purpose/use of NSObject in Objective-C? I see classes that extend NSObject like this: @interface Fraction : NSObject In C++ or Java, we don't use any variables like NSObject even though we have preprocessor directives and import statements in both Objective-C and Java. Why do classes explicitly inherit from NSObject in O...

Difference Between Object And NSObject

Hello, I'm learning Objective-C and as I can see, in some tutorials they use Object(imported from objc/Object.h) and in others i see the use of NSObject(imported from Foundation/NSObject.h), but what are the main differences between they? Regards. ...

How can I debug objects on XCode the same way I do in Eclipse?

Hello! I'd like to see the content of NSObjects like properties ( arrays, Integers, floats... ). Since I'm a Flex developer I'm used to use the eclipse debugging tool. But now I'm starting with the iPhone I'm kind of lost. For example, I just downloaded the SeismicXML application from the dev's sample code, and I put a breakpoint on th...

NSManagedObject for temporary use, how to switch between NSObject and NSManagedObject

Hi Im using a Core Data model for my iPhone app. I have been looking for a way to instantiate or use an Entity outside the ManagedObjectContext. (This should not be done, I know, Im also more looking for a way to not do that, but get the benefits anyway). My challenge is that I have a view where the user can search for "Persons", all t...

Questions About The Foundation And NS Library

Hello, I'm a Objective-C learner and I don't have a Mac, then I need to use my Linux with GNUStep, but if I develop my own program on it, the end-user will need to have GNUStep(like .Net) installed and then I started thinking how can I solve this, then I had an idea: "Create this from scratch!", but now to do this I need to know: What ar...

Why use (id) in a method signature when (NSObject *) would be more precise?

Whenever I implement a method in my own code that can accept or return objects of more than one class, I always try to use the most specific superclass available. For example, if I were going to implement a method that might return an NSArray * or an NSDictionary * depending on its input, I would give that method a return type of NSObje...

Access IBOutlet from other class (ObjC)

Hi, I've googled around and found some answers but I didn't get any of them to work. I have one NSObject with the class "A" and a second class "B" without an NSObject. In class "A" are my IBOutlets defined and I can't seem to figure out how to access those outlets from class "B"... I've found answered questions like http://forums.macru...

Cocoa Bindings: NSObjectController not KVC-compliant for the representedObject property

I've been through a bunch of Core Data examples and the Apple documentation. I'm at a wall after working on this all day. All I want to happen is I type some text into a text field, save the file, open it again and see the text there. I made a very very simple Core Data document-based app to experiment. Here are the particulars: 1) ...

NSObjectController - setAutomaticallyPreparesContent:

I have a small core data app. I have a subclass of an NSObjectController acting as the binding between the view and the model and a NSTextField on the view for the user to type into. When the window opens the text field is editable because I have the bindings set to my subclassed NSObjectController, controller key to "content" and the ...

Where is 'Class Actions' in the 'Object Identity' panel in Interface Builder?

I thought I was fairly experienced at iPhone development, but I'm tripping up on the Stanford iPhone course on the very first video http://deimos3.apple.com/WebObjects/Core.woa/Browse/itunes.stanford.edu.3124430053.03124430055 (38 mins in) Cannistraro, the teacher, drags an NSObject into the MainWindow.xib. And when he inspects the Ob...