Re: Chapter 6 Challenge Help!

2008-07-17 Thread publictom

Hi Eric,

everything correct so far (datasource, IBAction). You have to write some
methods for the NSTableDataSource protocol.

Here is what worked for me:


//
//  AppController.h
//  ToDoList
//
//  Created by Tom on 04.07.08.
//  Copyright 2008 __MyCompanyName__. All rights reserved.
//

#import Cocoa/Cocoa.h


@interface AppController : NSObject {
IBOutlet NSTextField *textField;
IBOutlet NSTableView *tableView;
NSMutableArray *array;
}
- (IBAction) add:(id) sender;
@end

//
//  AppController.m
//  ToDoList
//
//  Created by Tom on 04.07.08.
//  Copyright 2008 __MyCompanyName__. All rights reserved.
//

#import AppController.h

@implementation AppController
- (id) init
{
[super init];
array = [[NSMutableArray alloc] init];

return self;
}

- (IBAction) add:(id) sender
{
NSString *string = [textField stringValue];
NSLog(@Got string %@ from textfield, string);

[array addObject:string];
[tableView reloadData];
}

- (NSInteger)numberOfRowsInTableView:(NSTableView *)aTableView
{
return [array count];
}

- (id)tableView:(NSTableView *)aTableView objectValueForTableColumn: 
(NSTableColumn *)aTableColumn row:(NSInteger)rowIndex

{
return [array objectAtIndex:rowIndex];
}

- (void)tableView:(NSTableView *)aTableView setObjectValue:anObject  
forTableColumn:(NSTableColumn *)aTableColumn row:(int)rowIndex

{
[array replaceObjectAtIndex:rowIndex withObject:anObject];
}
@end

Hope this helps,

Tom


Am 17.07.2008 um 05:33 schrieb Eric Lee:

First of all, I'm' new to cocoa, so I'm a beginner that just  
started. I'm trying to make the To-Do list on Chapter 6 from Aaron's  
new book, Cocoa Programming for Mac OS X Third Edition.


I've made an NSMutableArray, set the data source of the NSTableView  
to AppController, made an IBACTION and connected it to a Button,  
made a text field, and connected the AppController and the text  
field, and made an outlet for the table view, and connected it to  
the app controller.


For the .m file, I used:

NSString *string = [textField stringValue];
[array insertObject:string atIndex:0];

Then I got stuck


Help please?
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/publictom%40mac.com

This email sent to [EMAIL PROTECTED]


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Re: Concurrent network transmission

2008-07-17 Thread publictom

Erm,

not sure if this is still cocoa. In terms of TCP/IP there is no device  
to select,
its just the systems routing tables that decide which way to go ... so  
no API needed.


Tom

Am 17.07.2008 um 14:04 schrieb Matt Gough:



On 17 Jul 2008, at 1:41pm, em wrote:

Every computer that Apple sells contains both fire-wire as well as  
built-in Ethernet.  Is there any generally re-useable technique  
(API?) for utilizing
TCP/IP over both the built-in Ethernet connection as well as 'TCP- 
IP over firewire' for high-speed network transmission?

thanks,


Note - The MacBook Air does NOT have firewire.

For those with Firewire you can set up a network interface to use  
it. In the Network System Preferences you can add/Enable Firewire as  
a connection. As for APIs, sorry don't know myself.


Matt
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/publictom%40mac.com

This email sent to [EMAIL PROTECTED]


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]