• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag
 

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: How to locate which are not declared in header methods
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to locate which are not declared in header methods


  • Subject: Re: How to locate which are not declared in header methods
  • From: Greg Guerin <email@hidden>
  • Date: Thu, 13 May 2010 15:50:32 -0700

Steve Cronin wrote:

> Right now I don't have a handle on how much 'private' code there is in this class…..
>
> Are there any techniques for accomplishing my goal.


How many methods are in the interface? In other words, what's the complexity of doing it manually vs. the complexity of automating the process?

How proficient are you with command-line tools?

You can get a list of every method in the implementation by applying the 'nm' command to the .o file in the build folder. The '-P' option might be better than the default output without -P.

You can fake a list of every method in an interface by copying the interface methods into an otherwise empty implementation section of a duplicate .m file, globally replace ';' with '{}', and compile ignoring warnings. Then apply the 'nm' command to that .o.

With two sets of method names, it shouldn't be rocket science to write a perl or awk script to produce the set of symbols not in both sets. Or cat them together and pipe to 'sort': any repeated method is in the interface, and any unrepeated one is not.

Of course, time spent automating this task is time not spent doing the actual task. So it depends on how often the task is expected to be repeated, the complexity of the interface vs. the implementation, and one's actual skills in various command-line tools. It's like that old regex joke: You see a problem and you think "I can solve this with regular expressions". Now you have two problems.

  -- GG

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Prev by Date: Re: Very basic question
  • Next by Date: Mac OS X Deployment Target
  • Previous by thread: Re: How to locate which are not declared in header methods
  • Next by thread: Mac OS X Deployment Target
  • Index(es):
    • Date
    • Thread