• 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: NSMutableDictionary initialization problems
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSMutableDictionary initialization problems


  • Subject: Re: NSMutableDictionary initialization problems
  • From: James Spencer <email@hidden>
  • Date: Sun, 17 Oct 2004 15:32:25 -0500


On Oct 17, 2004, at 2:13 PM, Jacob Lukas wrote:

I have a subclass of NSDocumentController. In this subclass, I maintain a mutable array. Unfortunately, I cannot find a way to initialize it.

I tried the following methods in -init:
_myArray = [NSMutableDictionary dictionary];
-> _myArray is an NSCFString
_myArray = [NSMutableDictionary dictionaryWithDictionary:[NSDictionary dictionary]];
-> _myArray is a CFDictionary
_myArray = [[NSDictionary dictionary] mutableCopy];
-> _myArray is a CFDictionary

I tried initializing _myArray just before I use it:
if (!_myArray)
_myArray = [NSMutableDictionary dictionary];
[_myArray addObject:someObject];

but that doesn't work... _myArray is a CFDictionary


If _myArray is declared as a mutable array, i.e.

NSMutableArray * _myArray;

then why are you trying to initialize it with a dictionary?

James P. Spencer
Rochester, MN

email@hidden

"Badges?? We don't need no stinkin badges!"

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden
References: 
 >NSMutableDictionary initialization problems (From: Jacob Lukas <email@hidden>)

  • Prev by Date: turn off warnings for proxies
  • Next by Date: sortSubviewsUsingFunction Question?
  • Previous by thread: NSMutableDictionary initialization problems
  • Next by thread: Re: NSMutableDictionary initialization problems
  • Index(es):
    • Date
    • Thread