return a static const []
So in my model I have the following code... I am successfully able to return each individual value. I want to know how am I able to return the entire speakerTable []... Maybe some advice. Thanks!


    typedef struct {
    	NSUInteger speakerID;
    	NSString * speakerName;
    	NSString * speakerPosition;
    	NSString * speakerCompany;
    } SpeakerEntry;
    
    static const SpeakerEntry speakerTable [] = 
    {
    	{0, @"name", @"position", @"company"},
    	{1, @"name", @"position", @"company"},
    	{-1, nil, nil, nil}
    };

This works correctly...

    -(NSString *) stringSpeakerCompanyForId:(NSUInteger) identifier{
	NSString * returnString = nil;
	if ([self helpCount] > identifier) {
		returnString = speakerTable[identifier].speakerCompany;
	}
	return returnString;
}

This does not work at all..
    
    -(id) getSpeaker{
	//if ([speakerTable[0].speakerName isKindOfClass:[NSString class]])
	//	NSLog(@"YES");
	NSArray * myArray3 = [NSArray arrayWithArray:speakerTable];
	return myArray3;
}
return a static const []
===

So in my model I have the following code... I am successfully able to return each individual value. I want to know how am I able to return the entire speakerTable []... Maybe some advice. Thanks!


    typedef struct {
    	NSUInteger speakerID;
    	NSString * speakerName;
    	NSString * speakerPosition;
    	NSString * speakerCompany;
    } SpeakerEntry;
    
    static const SpeakerEntry speakerTable [] = 
    {
    	{0, @"name", @"position", @"company"},
    	{1, @"name", @"position", @"company"},
    	{-1, nil, nil, nil}
    };

This works correctly...

    -(NSString *) stringSpeakerCompanyForId:(NSUInteger) identifier{
	NSString * returnString = nil;
	if ([self helpCount] > identifier) {
		returnString = speakerTable[identifier].speakerCompany;
	}
	return returnString;
}

This does not work at all..
    
    -(id) getSpeaker{
	//if ([speakerTable[0].speakerName isKindOfClass:[NSString class]])
	//	NSLog(@"YES");
	NSArray * myArray3 = [NSArray arrayWithArray:speakerTable];
	return myArray3;
}