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 7878055
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T03:33:05+00:00 2026-06-03T03:33:05+00:00

So I am really new to cocoa programming. In fact I am very new

  • 0

So I am really new to cocoa programming. In fact I am very new to the Mac platform too. Still trying to get used to the fact that control+left arrow takes me to the beginning of the line.

Ok:
So I am working through the tutorials in the book ‘Cocoa Programming (4th edition) by Hillegass). So I got to chapter 9, which walks through creating a document view app, that uses a NSArrayControler to bind to a NSMutableArray of Person’s.

The tutorial walked me through creating a sub-class of document, and adding a NSMutableArray pointer. So I took some liberty and named it mEmployee’s instead of just employees.

@interface RMDocument : NSDocument
{
    NSMutableArray* mEmployees;
}
-(void) setmEmployees:(NSMutableArray*)a;

-(void) insertObject:(Person*)p inEmployeesAtIndex:(NSUInteger)index;
-(void) removeObjectFromEmployeesAtIndex:(NSUInteger)index;

-(void) startObservingPerson:(Person*) person;
-(void) stopObservingPerson:(Person*) person;

@end

Now when I did this, it seems the binding broke on the NSArrayController. So methods like setEmployee, insertObject and removeObject were never called.

Now I am still very new to objective-C, but I thought that mEmployee’s was an internal member variable to my ‘RMDocument’ interface and that I could name it what-ever I want. I wanted to prefix the name with ‘m’ in order to distinguish it from other variable names (Kind of like member variables in C++). Apparently that was a big no no.

So why is the variable name had such a big effect?

I have placed the entire source for the project at:
https://www.dropbox.com/sh/fq166ap3xzlw5xc/EZJXqIZPRY/RaiseMan

Thanks!

  • 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-06-03T03:33:07+00:00Added an answer on June 3, 2026 at 3:33 am

    The name of your accessor method needs to follow the naming conventions: for a property “foo”, the setter is “setFoo” (note the capitalization). So, you need to have setMEmployees, not setmEmployees.

    As a side note, your idea of prefixing member variables with “m” is not typical Cocoa style; it may make your code more difficult for others to read.

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

Sidebar

Related Questions

I'm fairly new to Objective-C and cocoa programming, so I don't really understand the
I'm really new to .NET, and I still didn't get the hang about how
I really new to this git and trying to get it work with xcode4.
I`m really new in Objective-C and Mac OSX programming. Can someone give me simple
I am really new to C++ programming so please pardon my silly question. I
I'm sure this is a really easy to answer question but I'm still new
I'll start by saying that I'm new to cocoa development. I'm also surprised I
Really new to kinect. I am trying to read up material I find. I
I am quite new to Cocoa and to iPhone programming. I am using the
I am sorry, I am new with cocoa programming and I am not sure

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.