nsobject

Unable to load a UIView in a separate ViewController with an NSObject

Hi all, The app is a viewbased project type. I am using a NSObject in a View XIB(UIView Nib), assume this object to be the topbar of the app. MainController UIViewController loads the initial screen. it looks like this, UIViewController MainViewController Image i wanted to load a Top view(new one, call it X) Designed separately in t...

Adding an object with "text"

Hello, I'm stumped or just not finding info I need, I have an object that I want to save in an array when they select "saveDataround" button, however I can't seem to figure out how to populate the object with the text "Round": I'm getting an "Expected identifier" and "Expected , ;" errors on the first and second lines of code. Thanks in...

I want to merge two object either in an array or prior to saving

I am saving the first and last name from ABpeoplepickerNavcontroller, I would like to merge the first and last name prior to saving into an array so that when i retrieve it, they would be together. The first code is the object being created: // setting the first name firstName.text = (NSString *)ABRecordCopyValue(person, kABPersonFirstN...

Over-riding NSObject and adding a class variable

I am using the following code to perform a selector after a delay with multiple passed parameters: http://nifty-box.com/blog/2006/12/nsinvocation-cleans-code.html It works very well, but I need to extend this to support the equivalent of: [NSObject cancelPreviousPerformRequestsWithTarget:self] (target in this case would not be self, ...

C-structs, NSObjects, float, int, double, ...

Hello, First of all: this is a though question, sorry for that, but I hope someone can help me! I'm making a UIML renderer on the iPhone. UIML is a language to describe interfaces. I want to render the XML and show the Interface on the iPhone. To inform you bettter, i first explain what I'm doing: <?xml version="1.0"?> <uiml> <in...

issues make a persistent object in Objective C

Attempting to make a NSObject called 'Person' that will hold the login details for my application (nothing to fancy). The app is made of a navigation controller with multiple table views but I am having issues sharing the Person object around. Attempted to create a static object like this: + (Person *)sharedInstance { static Person...

Subclassing NSObject, can it cause problems?

I have a very basic data class that is subclassed from NSObject. I declare a few strings, make sure they have properties (nonatomic, copy), and synthesize them. The only method I implemented was dealloc() which releases my strings. Can any memory problems arise from just this? Are there any other methods I need to implement? ...

[iPhone]Objective C, objects which do not conform to NSCoding. How to write them to a file.

Hi, I am using an Objective c class, a subclass of NSObject. This class cannot be modified. I have an instance of this class that I wish to write to a file which can be retrieved and later reinstate. The object does not conform to NSCoding. To sum up, I need to save an instance of a class to a file which can be retrieved later, without ...

How do I make a custom delegate protocol for a UIView subclass?

I'm making some tabs and I want to have my own delegate for them but when I try to send an action to the delegate nothing happens. I also tried following this tutorial: link text But it doesn't work for me :( Here is my code: TiMTabBar.h @protocol TiMTabBarDelegate; @interface TiMTabBar : UIView { id<TiMTabBarDelegate> __de...

NSObject release destroys local copy of object's data

I know this is something stupid on my part but I don't get what's happening. I create an object that fetches data & puts it into an array in a specific format, since it fetches asynchronously (has to download & parse data) I put a delegate method into the object that needs the data so that the data fetching object copies it's formatted a...

Is it possible to make a subclass of NSObject which support subnodes in IB for iPhone project?

I'm making a custom UI element class for iPhone. It'll cool to edit my class on Interface Builder with hierarchy. Some of my class is management class like UINavigationController, but they're not one of them, subclassed from NSObject. Of course, I can place a NSObject instance on IB, but it cannot have a child node. Is there a way to e...

Objective C object by string name?

Is it possible to find the object named with specific string. For example i can use that in php $objectname="foo"; $foo="bar"; echo $$objectname="bar"; is this possible? objectbyname would a proper function for this. ...

Implementation help... Subclass NSManagedObject?

I'm working on an app where I have some products that I download in a list. The downloaded products are displayed in a table and each will is showing a detail view with more information. These same products can be saved as a favorite, and for this I am using Core Data. I'd like to be able to re-use a bunch of views for displaying the p...

How to understand NSObject, it is both protocol and interface.

You can see following in NSObject.h file // 1. here is a protocol @protocol NSObject // 2. here is an interface, conforming to the above protocol @interface NSObject <NSObject> { ... // 3. what is the meaning of "( )" below? NSCoderMethods is a protocol @interface NSObject (NSCoderMethods) NSObject is so important that...

NSObject default constructor

Hi all, The default constructor of NSObject is this? -(id)init { return self; } thanks! ...

Correct handling of asynchronous NSObject

I have a situation similar to this: http://stackoverflow.com/questions/2698591/objective-c-how-to-use-memory-managment-properly-for-asynchronous-methods I have an object that asynchronously downloads & parses an xml doc. It then has a delegate method that transfers the data it retrieved to the caller. My 2 questions are: When do I rel...

Objective C Memory Management Woes

I know this has been discussed ad-nauseum but I just don't get some of the memory management. I understand that retain keeps the object alive and copy gives one a separate copy of an object. What I don't get is when it comes to ivars & properties, retain as a property means that the setter releases the old value & retains the new: prop...

iPhone Int with NSObject &/causes class can't reference itself

I've got a function called updateTheValue() that I have called using [self updateTheValue] for a while now. Two things happened recently; I added the method calling in the viewDidLoad() method and it spit out a warning saying my class may not respond to this. Second, I want to pass objects to updateTheValue() like strings, but mostly int...

Can't set an object in ObjC?

Whenever my method sets an object to onTouchEventReceiver, it gets lost when another method is called by another thread. //In header id onTouchEventReceiver; SEL onTouchSelector; - (void) setOnTouchSelector:(SEL)sel withObject:(id)obj { NSLog(@"setting obj to %@",obj); onTouchSelector = sel; [self setOnTouchEventReceiver:ob...

reimplementing NSObject from scratch

When I was reading about the new 4.0.2 iOS update I wanted to know what hackers do or try doing with a buffer overflow, which after some wikipedia'ing got me interested in playing with malloc and thus creating my own "NSObject". I am not actually planning to use this in any of my applications, its only for learning and playing around wi...