Therefor, I think you'll find that your findings are indeed the expected behavior - if it's worked in the past it's due more to luck than to anything else.
-rob. On Dec 25, 2008, at 2:30 PM, Scott Wilson wrote:
I have an odd case. I've got a NSTextView delegate method which looks like this:- (BOOL) textView: (NSTextView *) textView clickedOnLink: (id) link atIndex: (unsigned) charIndex { ... NSURL *desiredURL; // is it a NSURL link or a NSString link? if ([link isKindOfClass: [NSString class]]) { ...desiredURL = [NSURL URLWithString: [link stringByAddingPercentEscapesUsingEncoding: NSUTF8StringEncoding] relativeToURL: lastOpened];} else if ([link isKindOfClass: [NSURL class]]) // this is the case which causes the problem!!{ desiredURL = link; // it's a regular file:// URL } else return NO;NSLog(@"url %@", [desiredURL path]); // get EXC_BAD_ACCESS if link was an NSURL... }If I change the code above to desiredURL = [link retain] everything is fine. I've used very similar code with no problems in a different context.Is it possible that link is being autoreleased before my method has returned?Thanks _______________________________________________ Cocoa-dev mailing list ([email protected]) 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/rob%40pinchmedia.com This email sent to [email protected]
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________ Cocoa-dev mailing list ([email protected]) 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 [email protected]
