FROM : Charles Srstka
DATE : Fri Oct 15 20:38:33 2004
On Oct 15, 2004, at 5:35 AM, j o a r wrote:
>
> On 2004-10-14, at 21.09, Eric Ocean wrote:
>
>> Before anyone writes to tell me that I should be initializing my
>> variables, I considered the NSPropertyListSerialization to *be* my
>> initializer. According to the documentation, it sets it to an
>> NSString * or nil.
>
> Yes, this is a bug (in the implementation and / or the documentation)
> - I have also filed a case for this problem.
>
> The workaround is to check if "data" is nil or not, and only ever
> access the error string if data is == nil.
>
> On 2004-10-15, at 12.10, Robert Martin wrote:
>
>> It looks like you're meant to be passing a pointer to an NSString,
>> but you are passing a pointer to nothing. Have you tried something
>> like: NSString *error = [NSString string]; ?
>
> No, Eric did the right thing - your code is not meaningful. NSString
> is immutable, so what do you expect that the receiving method would do
> with the string object that you pass to it?
What if you initialize the error string with NSString *error = nil; ?
Charles
DATE : Fri Oct 15 20:38:33 2004
On Oct 15, 2004, at 5:35 AM, j o a r wrote:
>
> On 2004-10-14, at 21.09, Eric Ocean wrote:
>
>> Before anyone writes to tell me that I should be initializing my
>> variables, I considered the NSPropertyListSerialization to *be* my
>> initializer. According to the documentation, it sets it to an
>> NSString * or nil.
>
> Yes, this is a bug (in the implementation and / or the documentation)
> - I have also filed a case for this problem.
>
> The workaround is to check if "data" is nil or not, and only ever
> access the error string if data is == nil.
>
> On 2004-10-15, at 12.10, Robert Martin wrote:
>
>> It looks like you're meant to be passing a pointer to an NSString,
>> but you are passing a pointer to nothing. Have you tried something
>> like: NSString *error = [NSString string]; ?
>
> No, Eric did the right thing - your code is not meaningful. NSString
> is immutable, so what do you expect that the receiving method would do
> with the string object that you pass to it?
What if you initialize the error string with NSString *error = nil; ?
Charles
| Related mails | Author | Date |
|---|---|---|
| Eric Ocean | Oct 14, 21:09 | |
| j o a r | Oct 15, 12:35 | |
| Charles Srstka | Oct 15, 20:38 |






Cocoa mail archive

