• 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
Solved Re: No windows - [NSPlaceholderString initWithString] nil string (or other) argument
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Solved Re: No windows - [NSPlaceholderString initWithString] nil string (or other) argument


  • Subject: Solved Re: No windows - [NSPlaceholderString initWithString] nil string (or other) argument
  • From: Robert MacGregor <email@hidden>
  • Date: Fri, 9 Jan 2004 09:42:03 -0500

On Jan 8, 2004, at 11:03 AM, Robert MacGregor wrote:

I have an NSDocument cocoa app that generates this console message every time I start the app or click it's dock icon:

[NSPlaceholderString initWithString] nil string (or other) argument

I'd passed an argument to [NSString stringWithString:arg]with arg set to nil.

The argument was related to machine configuration hence it worked on my G4 computers but not my iBook. The console message is an exception thrown from NSString's implementation called NSPlaceholderString.

NSString * string1 = [NSString stringWithString:nil];

generates this console message:

*** Uncaught exception: <NSInvalidArgumentException> *** -[NSPlaceholderString initWithString:]: nil string (or other) argument

Using the document architecture embedded my code in an event loop that consumed the exception message. Interestingly the exception was consumed and then my app continued to run. That's why I see:

-[NSPlaceholderString initWithString:]: nil string (or other) argument


Remedies:
1) Judicious use of NSParameterAssert to check parameters.

2) Implement exception handling.

Rob



My app runs OK on a PowerBook G4 and G4 tower. I see the message on an iBook G4. All machines are running OS X 10.3.2.

A Google search uncovered some hints about [super init] and initWithCoder. I've checked my initWithCoder calls and they look OK. I think I understand the placeholder class idea.

I tried copying my app's project to the iBook and building there but with no success.

I'm guessing this is a NIB-related problem. Anyone else have this problem?


Rob
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

References: 
 >No windows - [NSPlaceholderString initWithString] nil string (or other) argument (From: Robert MacGregor <email@hidden>)

  • Prev by Date: Converting encodingName to NSStringEncoding
  • Next by Date: NSOpenPanel
  • Previous by thread: No windows - [NSPlaceholderString initWithString] nil string (or other) argument
  • Next by thread: NSWindow's firstResponder and a pointer to that object.
  • Index(es):
    • Date
    • Thread