On Oct 15, 2009, at 10:41 pm, Nathan Vander Wilt wrote:
Ouch. So the following pattern is incorrect?
NSError* internalError = nil;
(void)[foo somethingReturningBool:bar error:internalError];
if (internalError) {
// ...
}
Bill Bumgarner wrote:
On Oct 15, 2009, at 10:41 PM, Nathan Vander Wilt wrote:
...
You're saying that some methods go out of their way to trample my
(potentially unavailable) error storage even on success?
If the error storage is not available, as indicated by passing an
NSError** of nil,
(response is pedantic for the purposes of the archive :)
even more better flaming pedanticism!
On Oct 15, 2009, at 10:41 PM, Nathan Vander Wilt wrote:
Ouch. So the following pattern is incorrect?
Yes; it is incorrect.
NSError* internalError = nil;
(void)[foo somethingReturningBool:bar
On 16/10/2009, at 4:45 PM, Ben Trumbull wrote:
Other people have different perspectives on local variable initialization.
Wrong perspectives, but different. Fortunately now, they waste their
arguments upon the merciless http://llvm.org/img/DragonFull.png
Clangdor the Burninator.
If we get an NSError, or in the case of NSAppleScript an NSDictionary
with the error description, what is the Retain count and do we release
it when we're done with it?
I'd been not releasing them, I didn't allocate or copy it, but when I
Build and Analyzed my code in 3.2 on Snow Leopard
On 2009 Oct 16, at 03:44, Kevin Bracey wrote:
If we get an NSError, or in the case of NSAppleScript an
NSDictionary with the error description, what is the Retain count
The retain count of an object is equal to 1 for alloc + the number of -
retain messages - the number of -release messages
Kevin Bracey wrote:
If we get an NSError, or in the case of NSAppleScript an
NSDictionary with the error description, what is the Retain count
and do we release it when we're done with it?
Wrong question. The retain count is not an ownership count. The
right question is Do I own it?
On Oct 2, 2009, at 7:45 AM, Bill Bumgarner wrote:
In either case, assuming the undefined reference is nil would be a
bug. Initializing the variables to nil prior to the call isn't going
to change anything in that regard.
(And, yes, there are methods that modify their error parameter on
(response is pedantic for the purposes of the archive :)
On Oct 15, 2009, at 10:41 PM, Nathan Vander Wilt wrote:
Ouch. So the following pattern is incorrect?
Yes; it is incorrect.
NSError* internalError = nil;
(void)[foo somethingReturningBool:bar error:internalError];
if (internalError)
On Thu, Oct 15, 2009 at 10:41 PM, Nathan Vander Wilt
nate-li...@calftrail.com wrote:
Ouch. So the following pattern is incorrect?
NSError* internalError = nil;
(void)[foo somethingReturningBool:bar error:internalError];
if (internalError) {
Indeed, this is very incorrect. If the existence
Stephen J. Butler wrote:
On Thu, Oct 1, 2009 at 10:31 PM, Colin Howarth co...@howarth.de
wrote:
NSStringEncoding *enc;
NSError *error;
NSString *file = [NSString
stringWithContentsOfFile:@/Users/colin/developer/Trace/glass.csv
usedEncoding:enc error:error];
The way you
On Oct 2, 2009, at 4:05 AM, Gregory Weston wrote:
While we're at it, the values of enc and error are (effectively)
nondeterministic before the message send. The documentation for the
method you're invoking doesn't specify what it'll put into the
encoding argument on failure or into the
On Fri, 02 Oct 2009 07:05:37 -0400, Gregory Weston gwes...@mac.com said:
Stephen J. Butler wrote:
On Thu, Oct 1, 2009 at 10:31 PM, Colin Howarth co...@howarth.de
wrote:
NSStringEncoding *enc;
NSError *error;
NSString *file = [NSString
On Oct 2, 2009, at 4:05 AM, Gregory Weston wrote:
It would be a good idea to get into the habit of initializing your
local variables at the point of declaration.
At the risk of starting a religious debate, I disagree. It makes the
code somewhat bigger and slower, and worse, it can mask
On 2 Oct, 2009, at 07:36, Stephen J. Butler wrote:
On Thu, Oct 1, 2009 at 10:31 PM, Colin Howarth co...@howarth.de
wrote:
NSStringEncoding *enc;
NSError *error;
NSString *file = [NSString
stringWithContentsOfFile:@/Users/colin/developer/Trace/glass.csv
usedEncoding:enc
Hi,
I'm trying to read a file using this code, which is failing:
NSStringEncoding *enc;
NSError *error;
NSString *file = [NSString stringWithContentsOfFile:@/Users/colin/
developer/Trace/glass.csv usedEncoding:enc error:error];
NSLog(@%i: %@,
Because userInfo is a dictionary and is obviously not what you want.
Using `po` winds up calling -description, which for NSError returns a
synthesis of its localizedDescription, localizedFailureReason,
localizedRecoveryOptions, and localizedRecoverySuggestion.
So if you want that info, just log
On Oct 1, 2009, at 20:31, Colin Howarth wrote:
Why is my NSLog statement being so unhelpful???
Try logging [error localizedDescription] instead. That's what the
debugger's showing you.
___
Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
On Thu, Oct 1, 2009 at 10:31 PM, Colin Howarth co...@howarth.de wrote:
NSStringEncoding *enc;
NSError *error;
NSString *file = [NSString
stringWithContentsOfFile:@/Users/colin/developer/Trace/glass.csv
usedEncoding:enc error:error];
The way you pass enc is also wrong.
19 matches
Mail list logo