xcode - Is it possible to "get" the h file when you're writing code in the m file -


i'm trying make plugin, , idea after write

-(void)thismethodissomethingiwanttobeexposed

then can press keycombo alt+c , it'll write 1 current line in .h file don't have copy paste on myself.

anyone have idea on how path of file i'm writing in? can change m h, , i'll have figure out how write h file, that's thing.

i found solution, think might bit hacky.

in xcode plugin put in init

[[nsnotificationcenter defaultcenter] addobserver:self selector:@selector(notificationlistener:) name:nil object:nil]; 

and made method called

-(void)notificationlistener:(nsnotification *)notification{ if (![notification.name iskindofclass:[nsstring class]]) {      if ([[notification name] isequaltostring:@"idesourcecodedocumentdidupdatesourcemodelnotification"] ) {          nsstring *path =  [ nsstring stringwithformat :@"%@",notification.object ];         path = [path substringfromindex:49];       } 

you'll alot of notifications, , took me while find 1 information on path, 1 has it.

same method

nslog(@"not recv: %@", notification.name);  

will write out names of notifications.


Comments

Popular posts from this blog

c# - How to get the current UAC mode -

postgresql - Lazarus + Postgres: incomplete startup packet -

javascript - Ajax jqXHR.status==0 fix error -