-3

I try to write to out of the cells label but it not work.

My Code is like this:

cell.idNummer.text = [NSString string With Format: @"%@", laddataId]; 

In core data is laddataId an integer 32. What should I write to display in label?

Clement Herreman
  • 10,274
  • 4
  • 35
  • 57
Anders75
  • 1
  • 1

1 Answers1

1

Use this:

cell.idNummer.text = [NSString stringWithFormat:@"%d", laddataId]; 

Please see this. It will help a lot.

Hope this helps.. :)

Desdenova
  • 5,326
  • 8
  • 37
  • 45
Rashad
  • 11,057
  • 4
  • 45
  • 73
  • cell.idNummer.text = [NSString stringwithformat: @ "%i", laddataId]; not work. – Anders75 Apr 01 '14 at 07:20
  • Can you check the result of NSLog(@"%@", laddataId);? If it shows any warning please post that warning. – Rashad Apr 01 '14 at 07:23
  • Output 2014-04-01 09:33:29.663 Laddata[876:60b] INIT ( " (entity: Laddata; id: 0xd000000000040000 ; data: )", " (entity: Laddata; id: 0xd000000000080000 ; data: )" ) 2014-04-01 09:33:29.671 Laddata[876:60b] self.objects:nor 2 2014-04-01 09:33:29.675 Laddata[876:60b] (null) 2014-04-01 09:33:29.675 Laddata[876:60b] id nummer (null) – Anders75 Apr 01 '14 at 07:34
  • Please share you full code at least I saw a code as comment before that part will help. And was it the output of NSLog(@"%@", laddataId);? – Rashad Apr 01 '14 at 07:40
  • for (Laddata *obj in objects) { Laddata *obj = [self.objects objectAtIndex:indexPath.row]; cell.vapen.text = obj.vapen; cell.kaliber.text = obj.kaliber; cell.datum.text = obj.datum; cell.idNummer.text = [NSString stringWithFormat: @"%@",laddataId]; NSLog(@"%@", laddataId); – Anders75 Apr 01 '14 at 07:41
  • 2014-04-01 09:33:29.663 Laddata[876:60b] INIT ( " (entity: Laddata; id: 0xd000000000040000 ; data: )", " (entity: Laddata; id: 0xd000000000080000 ; data: )" ) 2014-04-01 09:33:29.671 Laddata[876:60b] self.objects:nor 2 2014-04-01 09:33:29.675 Laddata[876:60b] (null) 2014-04-01 09:33:29.675 Laddata[876:60b] id nummer (null) 2014-04-01 09:33:29.676 Laddata[876:60b] (null) – Anders75 Apr 01 '14 at 07:42
  • What is Laddata and laddataId? I mean what type of object are they? – Rashad Apr 01 '14 at 07:44
  • its not work cell.idNummer.text = [NSString stringWithFormat: @ "%i", laddataId]; – Anders75 Apr 01 '14 at 07:45
  • I asked you something please answer that first. – Rashad Apr 01 '14 at 07:46
  • Laddata is coredata entities. laddataId is [newLoading setValue:[NSNumber numberWithInt:arc4random() % 100] forKey:@"laddataId"]; laddataId is attribute in core data. – Anders75 Apr 01 '14 at 07:49
  • What is newLoading is it also a core data entity? – Rashad Apr 01 '14 at 07:51
  • textfield that save new data. A bit hard to explain everything, but I can email the project; – Anders75 Apr 01 '14 at 07:54
  • Anyone how to display the integer 32 from core data to the custom cell. This does not work? cell.idNummer.text = [NSString stringWithFormat: @"%i",laddataId]; – Anders75 Apr 01 '14 at 13:16