Re: [Q] Weird problem with the NSTableView
Re: [Q] Weird problem with the NSTableView
- Subject: Re: [Q] Weird problem with the NSTableView
- From: Shawn Erickson <email@hidden>
- Date: Wed, 06 Dec 2006 20:06:28 -0800
On Dec 6, 2006, at 7:57 PM, JongAm Park wrote:
Hello.
Recently I tried to write a small program which shows the string
encoding conversion table.
it should be easy and quick program.
However I ran into a strange problem. I didn't have this problem
before. So, it looks more strange.
For explanation, i would like to write some code here.
@interface ConversionController : NSObject
{
IBOutlet NSTableView *conversionTable;
NSArray *encodingStringArray_CF;
NSArray *description;
NSArray *availability;
NSMutableArray *encodingStringArray_NSString;
NSMutableArray *encodingStringArray_IANA;
}
@end
@implementation ConversionController
- (id) init
{
NSLog( @"init()");
encodingStringArray_CF = [NSArray arrayWithObjects:@"Jenny",
@"Tom", nil];
encodingStringArray_CF = [NSArray
arrayWithObjects:@"kCFStringEncodingMacRoman",
@"kCFStringEncodingMacJapanese",
@"kCFStringEncodingMacChineseTrad",
@"kCFStringEncodingMacKorean", ......., nil];
return self;
}
1) You appear to set the value of encodingStringArray_CF twice in the
above code.
2) You don't retain the array you assign to encodingStringArray_CF.
(review Cocoa memory management [1])
-Shawn
[1] <http://developer.apple.com/documentation/Cocoa/Conceptual/
MemoryMgmt/Concepts/ObjectOwnership.html>
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden