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 wanted.

Thanks again for the help.

--chris


On Oct 15, 2010, at 12:08 PM, Kiel Gillard wrote:

> 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 pointer to a NSString object.
> 
> Consider the return value of the - [NSScanner 
> scanCharactersFromSet:intoString:] method. If the method fails to scan the 
> given characters and returns NO, your theScannedString pointer is probably 
> still invalid.
> 
> Kiel
> 
> On 16/10/2010, at 5:44 AM, 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;
>> NSScanner *theScanner = [NSScanner scannerWithString:theNewHTML];
>> NSCharacterSet *theCharacterSet = [NSCharacterSet 
>> characterSetWithCharactersInString:@"1234567890abcdefghijklmnopqrstuvwxyz...@#$%^&*()-_=+<>?,./:\";'[]\{}|
>>  "];
>> [theScanner scanCharactersFromSet:theCharacterSet 
>> intoString:&theScannedString];
>>      
>> NSLog(@"%@",theScannedString);
>> 
>> Does anyone have a hint as to what may be the issue?
>> 
>> Thanks
>> 
>> --chris_______________________________________________
>> 
>> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
>> 
>> Please do not post admin requests or moderator comments to the list.
>> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
>> 
>> Help/Unsubscribe/Update your Subscription:
>> http://lists.apple.com/mailman/options/cocoa-dev/kiel.gillard%40gmail.com
>> 
>> This email sent to kiel.gill...@gmail.com
> 
> 

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to