-[NSNull length]: unrecognized selector sent to instance 0x2689678 2013-07-30 15:36:21.984 Pretyum[5006:c07]
Have code click TableView Item?
Date :
2013-07-30 18:00:50
By :
mr.win
Code (Objective-C)
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
return displayObject.count;
}
// TableView
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CellIdentifier = @"Cell";
Vendor_Home_Cell *cell = (Vendor_Home_Cell *) [tableView dequeueReusableCellWithIdentifier : CellIdentifier];
if (cell == nil) {
NSArray *nib = [[NSBundle mainBundle] loadNibNamed:@"Vendor_Home_Cell" owner:self options:nil];
cell = [nib objectAtIndex:0];
}
NSDictionary *tmpDict = [displayObject objectAtIndex:indexPath.row];
cell.lblposition.text = [tmpDict objectForKey:position];
cell.lbljobid.text = [tmpDict objectForKey:jobid];
cell.lblskills.text = [tmpDict objectForKey:skills];
cell.lbllocation.text = [tmpDict objectForKey:city];
cell.lblstate.text = [tmpDict objectForKey:state];
cell.lblrate.text = [tmpDict objectForKey:rate];
cell.lblskills.numberOfLines = 0;
cell.lblskills.lineBreakMode = NSLineBreakByWordWrapping;
cell.lblposition.numberOfLines = 0;
cell.lblposition.lineBreakMode = NSLineBreakByWordWrapping;
cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
return cell;
}
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
return 205.0f;
}
Code (Objective-C)
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
NSDictionary *tmpDict = [displayObject objectAtIndex:indexPath.row];
Vendor_Job_Details *detail = [[Vendor_Job_Details alloc] init];
detail.sJobID = [tmpDict objectForKey:jobid];
detail.sUser_id = _sUser_id;
[self.navigationController pushViewController:detail animated:YES];
[tableView deselectRowAtIndexPath:indexPath animated:YES];
}
ประวัติการแก้ไข 2013-07-30 18:28:55
Date :
2013-07-30 18:26:32
By :
vishwa
please reply
Date :
2013-07-31 12:04:20
By :
vishwa
sathish, Sorry this case i cannot debug help you. Can you use debug NSLog for seek line error.
รู้จัก NSLog กับ Objective-C บน iOS (for iPhone and iPad Dev)
Date :
2013-07-31 12:31:58
By :
mr.win
Thanks mr.win
I will try to solve
Date :
2013-07-31 12:36:35
By :
vishwa
DESC: <null>
when I retrieve data some data showing as a "null" character but in my database some data is there.
Date :
2013-07-31 12:45:48
By :
vishwa
Back to check on php/mysql
Date :
2013-07-31 12:47:48
By :
mr.win
Thanks mr.win
you are right. when i run api i got in some value coming perfect but some value coming with "null" character. but in database have some value that particular field.
I am using this php code. How to solve his null value?
Code (PHP)
<?php
$objConnect = mysql_connect("localhost","root","");
$objDB = mysql_select_db("sample");
$strSQL = "SELECT * FROM sample_admin WHERE 1 ORDER BY job_id DESC";
$objQuery = mysql_query($strSQL);
$intNumField = mysql_num_fields($objQuery);
$resultArray = array();
while($obResult = mysql_fetch_array($objQuery))
{
$arrCol = array();
for($i=0;$i<$intNumField;$i++)
{
$arrCol[mysql_field_name($objQuery,$i)] = $obResult[$i];
}
array_push($resultArray,$arrCol);
}
mysql_close($objConnect);
echo json_encode($resultArray);
?>
Date :
2013-07-31 13:22:46
By :
vishwa
Code (Objective-C)
if (DESC == [NSNull null]) {
// DESCis null
}
check null before assign to Label
Date :
2013-07-31 13:35:46
By :
mr.win
Thanks mr.win
I used this code working perfect. But result is displaying empty.
Date :
2013-07-31 13:48:51
By :
vishwa
Thanks mr.win now working perfect.
Date :
2013-08-02 18:25:16
By :
vishwa
Date :
2013-08-02 20:54:33
By :
mr.win
Load balance : Server 03