objectAtIndex quandry
objectAtIndex quandry
- Subject: objectAtIndex quandry
- From: James Stroud <email@hidden>
- Date: Sat, 22 May 2004 03:16:12 -0600
Sorry for the triple post. I included a stack trace on the first and
now that message awaits moderator approval, making my second message
difficult to interpret because of its lack of context. In case the
moderators are taking the weekend off, I am clarifying here. So, to
clarify the clarification, if I call "updateTheStringDisplay:sender"
every thing works fine. Then, without doing anything in between, I call
"updateTheElementDisplay:sender" and I get the error message:
2004-05-22 03:04:32.046 Test[699] *** -[NSCFNumber objectAtIndex:]:
selector not recognized
Code is below.
--
// AppController.h
#import <Foundation/Foundation.h>
@interface AppController : NSObject {
IBOutlet id theStringDisplay ;
IBOutlet id theElementDisplay ;
NSString *theString ;
NSArray *theArray ;
}
- (IBAction)updateTheStringDisplay:(id)sender ; // called first with a
button to get going
- (IBAction)updateTheElementDisplay:(id)sender ; // called immediately
after
@end
// End of AppController.h
// AppController.m
#import "AppController.h"
@implementation AppController
- (IBAction)updateTheStringDisplay:(id)sender
{
theString = @"bob carol ted alice fred wilma barney betty bambam" ;
theArray = [theString componentsSeparatedByString:@" "] ;
[theStringDisplay setString:theString] ;
[theElementDisplay setStringValue:[theArray objectAtIndex:0]] ;
}
- (IBAction)updateTheElementDisplay:(id)sender
{
[theElementDisplay setStringValue:[theArray objectAtIndex:3]] ;
}
@end
---------------------------------------------------------
James Stroud
Department of Chemistry
University of Colorado
Boulder, CO 80309-0215, USA
tel: 303-492-4503
www:
http://JamesStroud.com/
--------------------------------------------------------
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.