Solved Re: No windows - [NSPlaceholderString initWithString] nil string (or other) argument
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.