# I Need Help...



## martinatkinson (Sep 9, 2001)

Hello!

I need help with programming an app.  I have a window with a list view and a text box.  (by the way I am using Project Builder and Interface Builder and programming in the Cocoa lanquage)  I would like there to be a list of choices in the list view and when the user clicks on a choice, text appears in the text box below (open Apple's "Mail.app" as an example.  Click on a message in their list view, the body of the message appears in the text box below.  That is pretty much waht I want although the text in the list view is NOT user defined.)  Could you help me out with this or refer me to a website that can help? 

Thank you so much!

Albert


----------



## endian (Sep 9, 2001)

http://developer.apple.com/techpubs...ObjC_classic/Protocols/NSTableDataSource.html
http://www.oreilly.com/catalog/learncocoa/apple/ch10.html


----------



## martinatkinson (Sep 9, 2001)

That should keep me busy!   

Thanks for the links!    Looks like it would be a good investment to purchase that book.  I need help with only one more thing (at this time).  Do you know how I would link a button or a menu item to a URL?  I would like to have a button that users can click to go to my website to check out the latest news, updates, etc.

Again thanks!

Albert


----------



## endian (Sep 9, 2001)

That's an easy one 

Just add an action called visitWebPage (or whatever) to your object, connect the button to it, and add the following code in PB:


```
-(IBAction)visitWebPage:(id)sender
{
	[[NSWorkspace sharedWorkspace] openURL:
	[NSURL URLWithString:@"http://url.to/page/goes/here/"]];
}
```

Note that the internet prefs in 10.0.4 can get screwed up fairly easily, so if this doesn't work, check that.


----------



## martinatkinson (Sep 10, 2001)

Thank you so much for your help.  I will let you know if I need anything else.

Have a great day!

Albert


----------



## martinatkinson (Sep 10, 2001)

Hello again!

OK, first of all I would like to rename my default NIB file from MainMenu.nib to something else.  The only problem is that Project Builder has in its code (somewhere) the name of the default NIB file so when I rename it I get messed up.  Where is the name of the NIB file in the code so I can change it?

Secondly, I would like to link one NIB file to another one (if at all possible).  When the user clicks a button a the second NIB file would be opened and one of its windows would be displayed.  How is this done?  If it is possible to do will the window contained in the previous window still be open or will it close when the second NIB file is opened.

Thanks for your help!

Albert


----------



## endian (Sep 10, 2001)

> OK, first of all I would like to rename my default NIB file from MainMenu.nib to something else. The only problem is that Project Builder has in its code (somewhere) the name of the default NIB file so when I rename it I get messed up. Where is the name of the NIB file in the code so I can change it?



Project Menu > Edit Active Target > Application Settings tab > Main nib file




> Secondly, I would like to link one NIB file to another one (if at all possible). When the user clicks a button a the second NIB file would be opened and one of its windows would be displayed. How is this done? If it is possible to do will the window contained in the previous window still be open or will it close when the second NIB file is opened.



look at AppKit/NSNibLoading.h


----------

