Lefora Free Forum
login join
Loading
457 views

Strange Difference between volumeName and volumeNameX

Page 1
1–1
rookie - member
1 posts

I've just started learning cocoa and had a go at typing in those lovely example programs...

Can't get simpler than changing a label when you press a button...

However if I name the NSTextField as volumeName it doesn't work.
If I change it and the connections to volumeNameX it does work.

I tried searching for volumeName in case it's some reserved label but it doesn't appear in a search of the API's.

Any ideas ?

Dave.

Test.h
<code>
#import <Cocoa/Cocoa.h>


@interface Test : NSObject {
    // Change this to anything but volumeName and everything works fine.
    IBOutlet NSTextField *volumeName;
}
- (IBAction)setVolumeName:(id)id;

@end
</code>
Test.m

#import "Test.h"

@implementation Test

- (IBAction)setVolumeName:(id)id
{
    // Change this to anything but volumeName and everything works fine.
 
  [volumeName setStringValue:@"Hello There"];
}
@end

Page 1
1–1

Locked Topic


You must be a member to post in this forum

Join Now!