I have create custom ui objects and add on table cell but I scroll the table then application is crash plz suggest me about the issue?

Please make the some changes in your code as per below.

Up vote -2 down vote favorite share g+ share fb share tw.

(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *CellIdentifier = nil;//@"Cell"; UITableViewCell *cell = tableView dequeueReusableCellWithIdentifier:CellIdentifier; if (cell == nil) { //cell = UITableViewCell alloc initWithFrame:CGRectZero reuseIdentifier:nil autorelease; cell = UITableViewCell alloc initWithStyle:UITableViewCellStyleDefault reuseIdentifier:nil autorelease; cell setSelectionStyle:UITableViewCellSelectionStyleNone; } UILabel *label = UILabel alloc initWithFrame:CGRectMake(5,20,150,20); label. Font = UIFont systemFontOfSize:15; label. BackgroundColor=UIColor clearColor; if (indexPath.

Row == 5){ if (isDriverPassenger) { label. Text = cellLabelsForDriver objectAtIndex:indexPath. Row; cell.

ContentView addSubview:label; NSArray *itemArray = NSArray arrayWithObjects: @"ON", @"OFF", nil; UISegmentedControl *segmentedControl = UISegmentedControl alloc initWithItems:itemArray; segmentedControl. Frame = CGRectMake(155, 17, 135, 40); segmentedControl. SegmentedControlStyle = UISegmentedControlStyleBordered; segmentedControl.

SelectedSegmentIndex = 0; segmentedControl addTarget:self action:@selector(dutyStatus:) forControlEvents:UIControlEventValueChanged; cell. ContentView addSubview:segmentedControl; segmentedControl release; }else{ label. Text = cellLabelsForPassenger objectAtIndex:indexPath.

Row; cell. ContentView addSubview:label; NSArray *itemArray = NSArray arrayWithObjects: @"Male", @"Female", nil; UISegmentedControl *segmentedControl = UISegmentedControl alloc initWithItems:itemArray; segmentedControl. Frame = CGRectMake(155, 17, 135, 40); segmentedControl.

SegmentedControlStyle = UISegmentedControlStyleBordered; segmentedControl. SelectedSegmentIndex = 0; segmentedControl addTarget:self action:@selector(selectPassengerGender:) forControlEvents:UIControlEventValueChanged; cell. ContentView addSubview:segmentedControl; segmentedControl release; } label release; return cell; }else if (indexPath.

Row == 8){ label. Text = cellLabelsForDriver objectAtIndex:indexPath. Row; cell.

ContentView addSubview:label; UIButton *typeOfRide = UIButton buttonWithType:UIButtonTypeRoundedRect; typeOfRide setFrame:CGRectMake(128, 10, 162, 65); typeOfRide. Tag = 1001; typeOfRide. TitleLabel setFont:UIFont boldSystemFontOfSize:12; typeOfRide setTitleColor:UIColor blackColor forState:UIControlStateNormal; typeOfRide addTarget:self action:@selector(pickeropen:) forControlEvents: UIControlEventTouchUpInside; cell.

ContentView addSubview:typeOfRide; typeOfRide release; label release; return cell; }else{ cell. ContentView addSubview:label; if (isDriverPassenger) label. Text = cellLabelsForDriver objectAtIndex:indexPath.

Row; else label. Text = cellLabelsForPassenger objectAtIndex:indexPath. Row; UITextField *txtField=UITextField allocinitWithFrame:CGRectMake(132, 20, 160, 55); txtField.

Font=UIFont systemFontOfSize:14; txtField. BackgroundColor=UIColor clearColor; txtField setBorderStyle:UITextBorderStyleNone; txtField setTextAlignment:YES; txtField setDelegate:self; cell. ContentView addSubview:txtField; txtField release; label release; return cell; } return cell; } iphone uitableview uitableviewcell link|improve this question edited Nov 25 '11 at 7:46Micha?

Powaga4,8471413 asked Nov 25 '11 at 6:39Satya32 0% accept rate.

Please make the some changes in your code as per below. Please not pass the reuseIdentifier:nil instead this write this static NSString *CellIdentifier = @"Cell"; reuseIdentifier:CellIdentifier. If problem not solved from this then make these changes in below.

Your Code: if (cell == nil) { //cell = UITableViewCell alloc initWithFrame:CGRectZero reuseIdentifier:nil autorelease; cell = UITableViewCell alloc initWithStyle:UITableViewCellStyleDefault reuseIdentifier:nil autorelease; cell setSelectionStyle:UITableViewCellSelectionStyleNone; } Edited Code: //cell = UITableViewCell alloc initWithFrame:CGRectZero reuseIdentifier:nil autorelease; cell = UITableViewCell alloc initWithStyle:UITableViewCellStyleDefault reuseIdentifier:nil autorelease; cell setSelectionStyle:UITableViewCellSelectionStyleNone; Thanks, MinuMaster.

Identifier value in method (id)dequeueReusableCellWithIdentifier:(NSString *)identifier; shouldn't be a nil: static NSString *CellIdentifier = @"Cell.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions