objective c - NSMenu Not connecting method of another class -
-(void)rightmousedown:(nsevent *)theevent { cvcont = [[collectionviweitemsubclass alloc] init ]; nsmenu * m = [[nsmenu alloc] init]; //[cvcont openinfinder];----perfectly working------ [self settarget:cvcont]; [m additemwithtitle:@"show in finder" action:@selector(openinfinder) keyequivalent:@""];// not working----- [nsmenu popupcontextmenu:m withevent:theevent forview:self]; }
i subclassed button , calling method class collectionviweitemsubclass
. if calling working. method not connected via nsmenu
. below code method class collectionviewitemsubclass
-(void)openinfinder { nsstring *savedvalue = [[nsuserdefaults standarduserdefaults] stringforkey:@"filepath"]; [[nsworkspace sharedworkspace] selectfile:savedvalue infileviewerrootedatpath:nil];
}
Comments
Post a Comment