Re: NSArray
Re: NSArray
- Subject: Re: NSArray
- From: "Jonathan del Strother" <email@hidden>
- Date: Mon, 2 Jun 2008 01:25:15 +0100
On Mon, Jun 2, 2008 at 1:02 AM, Nathan <email@hidden> wrote:
> here's my code:
>
> int x;
> - (IBAction)addNew:(id)sender {
> NSString *temp = @"Enter Todo Item Here";
> [Items addObject: temp];
> x=[Items count];
> [label setIntValue: x];
> [tableView setDataSource: Items];
> [tableView reloadData];
> }
>
> "Items" is a mutable array. "label" is a label for debugging. "tableView" is
> a tableview. When addNew is called, I want an object with the value of temp
> added to array "items". Then the tableView needs updating, so that it is
> displaying all items in the array. The code runs, I know my connections are
> good, but nothing happens. So I added the label who's connection I also know
> is good to make sure the items are getting added to the array and they
> aren't. When the button is pressed, no matter how many times, label always
> equals zero. What's wrong?
Try launching in a debugger and make sure Items isn't nil?
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden
References: | |
| >NSArray (From: Nathan <email@hidden>) |