Note that there are some explanatory texts on larger screens.

plurals
  1. POI can't get the Collection View Programming topics tutorial to work with XCode 5
    primarykey
    data
    text
    <p>I have done the Collection View Programming Topics three times now. Step by step, but there is no way I am getting any content in the collection view.</p> <p>The thing I have noted for the bindings of the NSText Labels when I bind them to representedObject. is that they get an exclamation mark.</p> <p>I have tried to set model key paths, xcode identifier, and title to no avail.</p> <p>I also get an extra view in addition to the collection view item.</p> <p>I hope anybody has an idea.</p> <p>I have asserted that the labels have fonts, and that the gridview has 0 rows and 1 column.</p> <p>Here is AppDelegate.h</p> <pre><code>#import &lt;Cocoa/Cocoa.h&gt; @interface AppDelegate : NSObject &lt;NSApplicationDelegate&gt; @property NSMutableArray *personModelArray; @property (assign) IBOutlet NSWindow *window; // To see if personModelArray is populated. - (IBAction) showElements:(id) sender ; @end </code></pre> <p>Here is AppDelegate.m</p> <pre><code>// // AppDelegate.m // Occupations #import "AppDelegate.h" #import "PersonModel.h" @implementation AppDelegate @synthesize personModelArray; - (void)awakeFromNib { PersonModel * pm1 = [[PersonModel alloc] init]; pm1.name = @"John Appleseed"; pm1.occupation = @"Doctor"; PersonModel * pm2 = [[PersonModel alloc] init]; pm2.name = @"Jane Carson"; pm2.occupation = @"Teacher"; PersonModel * pm3 = [[PersonModel alloc] init]; pm3.name = @"Ben Alexander"; pm3.occupation = @"Student"; NSMutableArray * tempArray = [NSMutableArray arrayWithObjects:pm1, pm2, pm3, nil]; [self setPersonModelArray:tempArray]; /* for (PersonModel *obj in personModelArray) { NSLog(@"%@ %@", obj.name, obj.occupation) ; } */ // NSLog(@"Awoken from nib %@",personModelArray) ; } // Convenience: hooked up with a button to see that // the contents of the array is still there! -(void)showElements:(id) sender { for (PersonModel *obj in personModelArray) { NSLog(@"%@ %@", obj.name, obj.occupation) ; } } - (void)applicationDidFinishLaunching:(NSNotification *)aNotification { // Insert code here to initialize your application } -(void)insertObject:(PersonModel *)p inPersonModelArrayAtIndex:(NSUInteger)index { [personModelArray insertObject:p atIndex:index]; } -(void)removeObjectFromPersonModelArrayAtIndex:(NSUInteger)index { [personModelArray removeObjectAtIndex:index]; } -(void)setPersonModelArray:(NSMutableArray *)a { personModelArray = a; } -(NSArray*)personModelArray { return personModelArray; } @end </code></pre> <p>Here is PersonModel.h</p> <pre><code>// // PersonModel.h // Occupations // #import &lt;Foundation/Foundation.h&gt; @interface PersonModel : NSObject { NSString * name; NSString * occupation; } @property NSString * name; @property NSString * occupation; @end </code></pre> <p>Here is PersonModel.m</p> <pre><code>// // PersonModel.m // Occupations #import "PersonModel.h" @implementation PersonModel @synthesize name; @synthesize occupation; @end </code></pre>
    singulars
    1. This table or related slice is empty.
    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.
 

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