Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5978693
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T21:33:10+00:00 2026-05-22T21:33:10+00:00

after my last question, regarding accessing an array from a different class, I ran

  • 0

after my last question, regarding accessing an array from a different class, I ran into an new problem, that’s giving me a headache for three days now. Everytime I think I have the correct solution approach, I fail.

Well… I don’t have many experience yet regarding Cocoa Programming. But maybe you are able to give me the missing hint.

Let me show you what approach I’ve chosen:

1) the declaration of an array in the class PortConnection.h/.m

@interface PortConnection : NSObject {
@private
    NSMutableArray *baudArray;
}
@property (nonatomic, retain) NSMutableArray *baudArray;

and the synthesize in .m

@implementation PortConnection
@synthesize baudArray;

Next I decided to implement a method in the ViewController that should be in charge of filling the array with data I need for display. The name of the class is “PortTableViewController.h”

#import "PortConnection.h"

@interface PortTableViewController : NSObject <NSTableViewDataSource, NSComboBoxDataSource> {
@private
    IBOutlet NSComboBox *baudSelection;
    PortConnection *portConnection;
}

@property (assign) IBOutlet NSTableView *portTableView;

- (IBAction)fillBaudSelection:(id)sender;

@end

and the implementation of my method “fillBaudSelection”.

- (IBAction)fillBaudSelection:(id)sender {

    int baudCount = [portConnection.baudArray count];
    int i;

    for (i = 0; i <= baudCount; i++){
        [baudSelection addItemWithObjectValue:[portConnection.baudArray objectAtIndex:i]];
    }
}

Furthermore I implemented the delegate methods for the combobox.

- (id)comboBox:(NSComboBox *)aComboBox objectValueForItemAtIndex:(NSInteger)index{
    return [portConnection.baudArray objectAtIndex:index];
}

- (NSInteger)numberOfItemsInComboBox:(NSComboBox *)aComboBox{
    return [portConnection.baudArray count];
}

My questions are:

1) Do I need to use the Delegate Methods for a combo box at all?
2) the Combobox isn’t filled with data at all, though the array is filled with data
3) Am I thinking to complicated??

Thanks so much for every hint I get from you!

best Regards
Sebastian

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T21:33:11+00:00Added an answer on May 22, 2026 at 9:33 pm

    Are you sure you hooked the combobox correctly? make sure the delegate and the datasource are set to whatever class has the methods implemented.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Ok, I'm now very confused. After my last question had several people comment about
After my last, failed, attempt at asking a question here I'm trying a more
I have a simple, general question regarding a real small issue that bothers me:
Since C# doesn't have a before,after,last,first etc. as part of its foreach. The challenge
After the last project I've done using WebForms, I've decided to pass on using
I want to get the characters after the last / in an url like
I am trying to append an image after the last input field in a
After the you guys helped me out so gracefully last time, here is another
After playing quite a bit of Bad Company 2 over the last month, I'm
After doing some work with Ruby, Rails, and RSpec last summer and I learned

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.