Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Technologx

macrumors member
Original poster
Dec 17, 2014
51
4
USA
I want to link the menu items to either my forum or a html document that or another view screen with info on it but I have no idea how to do that. I included a screenshot of what I want to work on.

Screen Shot 2016-02-18 at 7.07.36 PM.png
 

mfram

Contributor
Jan 23, 2010
1,338
380
San Diego, CA USA
The standard paradigm for Mac Apps is to link menu items to Actions in either the Application Delegate object or, more likely, a Controller object. Then the Controller would perform the tasks needed to create new Views and Views Controllers as necessary. A forum post is not the best place to explain the details of all these concepts. You should be looking for Mac App tutorials in either books or on the web.
 

Technologx

macrumors member
Original poster
Dec 17, 2014
51
4
USA
The standard paradigm for Mac Apps is to link menu items to Actions in either the Application Delegate object or, more likely, a Controller object. Then the Controller would perform the tasks needed to create new Views and Views Controllers as necessary. A forum post is not the best place to explain the details of all these concepts. You should be looking for Mac App tutorials in either books or on the web.

Alright well how do I link a menu item to another view xib?
 

mfram

Contributor
Jan 23, 2010
1,338
380
San Diego, CA USA
Alright well how do I link a menu item to another view xib?

I have written apps that do this in a number of ways.

In one app (a game), I used a single XIB which included the main game window and a high score window. The high score window would be hidden by default (set using the attributes for the window in the UI builder). Also, in the XIB, I instantiated a separate controller object for the high score window. When the user selected the "Show High Scores" option in the menu, that action would link to a method in the the high score window controller.

Code:
- (IBAction) doShowHighScores:(id)sender;
{
  [hsWindow makeKeyAndOrderFront:sender];

  hsData = [scores_manager getHighScores:nil];
  //NSLog(@"Fetch got %lu items", [hsData count]);
  [hsTable reloadData];
}

In this case, hsWindow is a IBOutlet to the High Score window. This design was easiest because there would only ever be one high score window. Just put everything in a single XIB.

This might make the most sense in your case if you want to present a single web view that shows the contents of an HTML document.

In another app, I wanted the ability to create multiple independent timer windows (think countdowns) on-the-fly. The user was allowed to keep creating new ones on demand. In that case, I created a separate XIB in my project which contained the timer window (text view with the time value, buttons to start and stop the timer, etc) and a controller object that would control that window. In the main program controller, I used the NSNib class to instantiate new copies of the objects (Window and Controller) in that "SubtimerWindow" XIB.

Code:
- (IBAction)makeNewTimer:(id)sender 
{
  NSNib *nnib = [[NSNib alloc] initWithNibNamed:@"SubtimerWindow" bundle:nil];
  NSArray *topLevelObjects;
  BOOL result;

  result = [nnib instantiateNibWithOwner:self topLevelObjects:&topLevelObjects];
  if (result)
  {
  [subTimerList addObject:topLevelObjects];
  }
}

Creating objects in a XIB is the same allocating objects in code. Interface Builder can make it more convenient to create things with graphical elements. But Interface Builder can also instantiate other objects like controllers. You use IBOutlets to reference those things IB creates.
 

Technologx

macrumors member
Original poster
Dec 17, 2014
51
4
USA
So how would I go about doing this when I want to link the About HiddenFileRemover menu item to a different view xib or storyboard?
 

Technologx

macrumors member
Original poster
Dec 17, 2014
51
4
USA
This is what I'm wanting to do so everyone who reads this doesn't get confused.

Screen Shot 2016-02-19 at 10.50.16 PM.png


Screen Shot 2016-02-19 at 10.50.25 PM.png
 

superscape

macrumors 6502a
Feb 12, 2008
937
223
East Riding of Yorkshire, UK
I think you are asking for too much from a simple forum thread.

Absolutely agree.

No offence intended, but you should probably think about working through some basic tutorials before diving straight into creating an app. There are plenty of good, free sources. If you look at iTunesU then there are some Stanford courses available for free, also raywenderlich.com has some basic beginner's guides. Maybe start here: http://www.raywenderlich.com/category/os-x
 

Technologx

macrumors member
Original poster
Dec 17, 2014
51
4
USA
I'd seriously suggest you read something like this:

http://www.apress.com/9781430245421

All of the responses you have to your questions will fall into place after that. I think you are asking for too much from a simple forum thread.
I don't have money for that crap
[doublepost=1456787822][/doublepost]
Absolutely agree.

No offence intended, but you should probably think about working through some basic tutorials before diving straight into creating an app. There are plenty of good, free sources. If you look at iTunesU then there are some Stanford courses available for free, also raywenderlich.com has some basic beginner's guides. Maybe start here: http://www.raywenderlich.com/category/os-x
I don't want to do that crap I want to create this sample app so I can create the app for my forum http://technologx.96.lt
 

superscape

macrumors 6502a
Feb 12, 2008
937
223
East Riding of Yorkshire, UK
A very interesting attitude.

mfram answered your specific question, and dryjoy and I recommended some more general tutorials to help you since you're clearly lacking some of the basic skills needed to create an app. If you don't have those skills already, and you're not willing to take the steps necessary to get them (regarding them as 'crap') then you may struggle. If that's the case then maybe you'd be better off hiring someone who already has those skills to create your app for you?
 

bjet767

Suspended
Oct 2, 2010
967
320
Dude

Many programmers have spent decades learning their trade and during those years invested $$ in books, online training and polite forum exchanges. You seem to want someone to do your work for you at no cost.

Hey, maybe you can find an answer on YouTube.
 
  • Like
Reactions: superscape

Technologx

macrumors member
Original poster
Dec 17, 2014
51
4
USA
I'm not wanting anyone to do my work for me all I want to know is what I need to do to link those 2 elements.
 

bjet767

Suspended
Oct 2, 2010
967
320
There's an outfit called "The Big Nerd Ranch" who has a multitude of books and tutorials on the subjects you desire. I also looked up your website and failed to see any references to apps or other things you mention here and on other threads. I did notice you seems to be a gamer and I wonder about some of your questions being more about hacking someone's system than developing an app.

Frankly you make me a bit suspicious.

Good luck on whatever you are doing.
 

bjet767

Suspended
Oct 2, 2010
967
320
Ok whatever you say, but this website/Facebook uses same avatar as you have here.

https://www.facebook.com/Technologx2013

This is a quote from the url you gave us:

"
Technologx is a place for people to come and learn. It's also a place for others to help each other. Our goal is to be the friendliest community we can be and the only way to do that is with your help.
"

So how come you don't follow your own advice and come here in a kind of demanding way?

I guess it is what it is.
 
  • Like
Reactions: Anderton

Technologx

macrumors member
Original poster
Dec 17, 2014
51
4
USA
I am trying to be kind man all I ask is how to do one thing that a lot of Mac app developers should know how to do but it don't seem like anyone knows how to do it or can point me to a guide that shows you how to do it. So don't quote my stuff to me man I don't like that.
 

bjet767

Suspended
Oct 2, 2010
967
320
  • Like
Reactions: jaduff46

jaduff46

macrumors 6502
Mar 3, 2010
328
187
Second star on the right....
Agree with the obviously experienced developers above, especially the sandbox thought. This is not a one-off question with a quick response.

Mfram gave you the framework for it, quite a bit of code and thought as a gift! If you don't understand it you should invest the $$ and time in one of the suggested websites to develop the skills and knowledge base you need.

You should be very cautious in dealing with hidden files. Had an inexperienced UNIX consultant in one of my early jobs who came close to turning the minicomputer into a piece of iron by attempting to recursively eliminate files in subdirectories with zero length to clean up things (the 30 terminal connections included).
 

jaduff46

macrumors 6502
Mar 3, 2010
328
187
Second star on the right....
Consider the thought that the "hidden files" you want to remove may be exactly what makes the device mountable and readable?! Your actions may turn the device into the very piece of iron I alluded to earlier.

Hence the sandbox idea where if you screw up you cant really do much harm to yourself while you're developing something new.

Don't you guys actually have development and production servers for the same reason?

Out of here!
 

bjet767

Suspended
Oct 2, 2010
967
320
This person's website link is nothing but an advertisement and links to other sites. They even ask for a paid membership.

Not to be trusted, run!
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.