Register FAQ / Rules Forum Spy Search Today's Posts Mark Forums Read
Go Back   MacRumors Forums > Apple Systems and Services > Programming > iPhone/iPad Programming

Reply
 
Thread Tools Search this Thread Display Modes
Old Jan 25, 2011, 11:24 PM   #1
mrl72
macrumors regular
 
Join Date: Apr 2008
Cannot add NSObject to NSMutableArray

Tearing my hair out over this one and not sure what I'm doing wrong. I have an object called "Feed" as such:

Code:
@interface Feed : NSObject {
	NSString *feedId;
}

@property (nonatomic, copy) NSString *feedId;
@end

----------
@implementation Feed
@synthesize feedId;

----------

In a method in my viewcontroller :

NSMutableArray *feedArray = [[NSMutableArray alloc] init];
Feed *feed = [[[Feed alloc] init] autorelease];
feed.feedId = @"test";
[feedArray addObject:feed];
NSLog([feedArray description]);
This is what I get:

2011-01-26 00:19:40.628 ffeed[33447:207] (
(null)
)

I have another class I set up exactly the same way and that works fine and the code looks identical, so maybe I missed a step somewhere. But then again it is late!

Any ideas?
mrl72 is offline   0 Reply With Quote
Old Jan 25, 2011, 11:33 PM   #2
North Bronson
macrumors 6502
 
Join Date: Oct 2007
Location: Los Angeles
When you call:

[feedArray description];

You can think of this as recursively asking each object in that array for its description. It looks like you haven't really taught your Feed objects how to describe themselves.
North Bronson is offline   0 Reply With Quote
Old Jan 26, 2011, 12:32 AM   #3
mrl72
Thread Starter
macrumors regular
 
Join Date: Apr 2008
Told you it was late lol.

Thanks!
mrl72 is offline   0 Reply With Quote

Reply
MacRumors Forums > Apple Systems and Services > Programming > iPhone/iPad Programming

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
thread Thread Starter Forum Replies Last Post
added objects to nsmutablearray, yet the array is null johnmerlino Mac Programming 4 Nov 11, 2011 10:50 PM
Trying to convert object to NSMutableArray johnmerlino iPhone/iPad Programming 4 Nov 11, 2011 03:08 AM
How to Add NSTimeInterval to NSMutableArray? Stunner iPhone/iPad Programming 2 Nov 12, 2009 12:31 AM
Cannot add folders to sys pref/desktop wallpaper islandsnow OS X 5 Aug 30, 2008 04:09 PM
Cannot add movies to iPod 60GB... majordude iPod 4 Sep 24, 2007 08:56 AM


All times are GMT -5. The time now is 07:50 AM.

Mac Rumors | Mac | iPhone | iPhone Game Reviews | iPhone Apps

Mobile Version | Fixed | Fluid | Fluid HD
Copyright 2002-2013, MacRumors.com, LLC