On Fri, 15 Oct 2010 22:45:57 -0400, Dave Keck said:
>>
>> NSString *theScannedString = nil;
>>
>> Now you can log that value successfully, even if nothing gets written
>>into
>> it. Then you can track down *why* nothing is getting written into it.
>>:) m.
>
>No initializing theScannedString does
> The problem is probably that theScannedString has never been initialize
> it. Always initialize when you declare, because otherwise your value could
> be nonsense and can't be logged. So, minimally, you'd say this:
Good advice regarding initialization, but...
> NSString *theScannedString = nil;
On Fri, 15 Oct 2010 11:44:26 -0700, Chris Tracewell
said:
>NOTE :: GC Enabled
>
>I am using an NSScanner in an NSString category but am crashing whenever
>I try to log the string I scanned into or to return it. If I comment out
>the NSLog there are no problems.
>
>NSString *theScannedString;
>NSSc
Thanks all. I got it working, indeed the Scanner was failing, which as Kiel
suggested, must have led to an invalid pointer by the time I tried to
log/return it. Once I checked the BOOL it quit crashing and then with some
reworking of my NSScanner code it processed and returned the string I wante
On Oct 15, 2010, at 12:00 PM, Hank Heijink (Mailinglists) wrote:
>> NSString *theScannedString;
>
> I would set theScannedString to nil here to avoid your crash below.
That would be making the assumption that the implementation of
scanCharactersFromSet:intoString: does not muck with the pointe
http://developer.apple.com/library/ios/documentation/cocoa/reference/foundation/Classes/NSScanner_Class/Reference/Reference.html#//apple_ref/occ/instm/NSScanner/scanCharactersFromSet:intoString:
You pass by reference to the - [NSScanner scanCharactersFromSet:intoString:]
method an uninitialised p
On Oct 15, 2010, at 2:44 PM, Chris Tracewell wrote:
> NOTE :: GC Enabled
>
> I am using an NSScanner in an NSString category but am crashing whenever I
> try to log the string I scanned into or to return it. If I comment out the
> NSLog there are no problems.
>
> NSString *theScannedString;
I
NOTE :: GC Enabled
I am using an NSScanner in an NSString category but am crashing whenever I try
to log the string I scanned into or to return it. If I comment out the NSLog
there are no problems.
NSString *theScannedString;
NSScanner *theScanner = [NSScanner scannerWithString:theNewHTML];
NSC