Re: Cocoa and dead-code stripping
Re: Cocoa and dead-code stripping
- Subject: Re: Cocoa and dead-code stripping
- From: Dirk Stegemann <email@hidden>
- Date: Tue, 3 Jul 2007 18:46:52 +0300
Hello,
Am 03.07.2007 um 18:32 schrieb Andre Schnoor:
No stripper is able to tell which (theoretically) reachable code
will actually be reached during runtime.
Exactly, so I think we can agree that every code which *might* be
called at runtime has to stay in the binary.
Wade Tregaskis gave a pretty perfekt example for a method call not
predictable by the linker/stripper:
.h
IBOutlet id myTextField;
.m
NSString *selectorName = [myTextField stringValue];
SEL newSelector = NSSelectorFromString(selectorName);
[myObject performSelector:newSelector];
That's a method name made up by the user of the program, at runtime;
he will get "selector not found" runtime errors for any method that
was stripped by the linker... and for any typos as well, of course ;-)
Best,
Dirk
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden