Note that there are some explanatory texts on larger screens.

plurals
  1. POfetch an NSSet from CoreData and show it in a Label
    primarykey
    data
    text
    <p>i have an nsset of room attributes(NSString), i stored them in CoreData. how can i fetch them to show it in a UILabel?</p> <p>i tried this in viewDidLoad:</p> <pre><code> NSArray *array = [[currentRaum raumattribute] allObjects]; [roomAttributLabel setText:[NSString stringWithFormat:@"%@",array]]; </code></pre> <p>but it didn't work. it shows some core data code <a href="http://i42.tinypic.com/eks5uc.jpg" rel="nofollow">Screenshot</a></p> <p>this is how i save my content:</p> <pre><code>Raum *raum2 = [NSEntityDescription insertNewObjectForEntityForName:@"Raum" inManagedObjectContext:context]; raum2.raumName = @"Main"; raum2.ort = @"Aschaffenburg"; raum2.strasse = @"Bruchtannenstr. 11"; raum2.etage = @"2. Stock, Raum 1.203"; raum2.beschreibung = @"Gut beleuchtet"; UIImage *img2 = [UIImage imageNamed:@"Main.jpg"]; NSData *data2 = UIImagePNGRepresentation(img2); raum2.foto = data2; NSSet *attributeFurRaum2 = [NSSet setWithObjects:attribute4,attribute5,attribute6,nil]; raum2.raumattribute= attributeFurRaum2; </code></pre> <p>Declaration of currentRaum:</p> <pre><code> self.currentRaum = [self.fetchedResultsController objectAtIndexPath:indexPath]; </code></pre> <p>i expected 3 different NSStrings which are saved like this:</p> <pre><code>Raumattribute *attribute4 =[NSEntityDescription insertNewObjectForEntityForName:@"Raumattribute" inManagedObjectContext:context]; attribute4.attributname = @"Copyboard"; Raumattribute *attribute5 =[NSEntityDescription insertNewObjectForEntityForName:@"Raumattribute" inManagedObjectContext:context]; attribute5.attributname = @"Flipchart"; Raumattribute *attribute6 =[NSEntityDescription insertNewObjectForEntityForName:@"Raumattribute" inManagedObjectContext:context]; attribute6.attributname = @"Internetmöglichkeit"; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload