Hi All,

I've been having some strange problems with an NSArray. It's probably something obvious, but I can't figure it out.

I have an AppController class with an NSArray instance value, called numbers. numbers stores NSStrings (which are numbers, but I don't need them as ints or anything). The code is as follows (allNumbers is all the numbers squished together):

numbers = [allNumbers componentsSeparatedByString:@"\t"];

NSLogging immediately after this reveals that this code is fine: the numbers have all ended up (as strings) into the array called numbers.

The numbers are supposed to be displayed in a table view, for which the AppController is set as the data source. But something seems to be going wrong with the array before the table view starts asking for data, because the contents of the array have become other, non string things. The following is a sample from GDB:

Running…
2008-07-27 19:46:37.064 Random[2698:813] numbers 0 is 3
2008-07-27 19:46:37.071 Random[2698:813] numbers 1 is 24
2008-07-27 19:46:37.083 Random[2698:813] numbers 2 is 84
2008-07-27 19:46:37.091 Random[2698:813] numbers 3 is 80
2008-07-27 19:46:37.100 Random[2698:813] numbers 4 is 81
(gdb) step

... lots of steps through AppKit & Foundation functions ...

Single stepping until exit from function -[NSApplication run],
which has no line number information.
(gdb) po numbers
NSRectSet {{{1, 0}, {242, 178}}}
(gdb) print (int) [numbers count]
$2 = 1
(gdb) print (id) [numbers objectAtIndex:0]
Target does not respond to this message selector.


So I'm befuddled. Any ideas? Sorry for the long post.

Daniel
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to