• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: [Q] Weird problem with the NSTableView
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: [Q] Weird problem with the NSTableView
      • From: JongAm Park <email@hidden>
References: 
 >[Q] Weird problem with the NSTableView (From: JongAm Park <email@hidden>)

  • Prev by Date: [Q] Weird problem with the NSTableView
  • Next by Date: Re: [Q] Weird problem with the NSTableView
  • Previous by thread: [Q] Weird problem with the NSTableView
  • Next by thread: Re: [Q] Weird problem with the NSTableView
  • Index(es):
    • Date
    • Thread