Note that there are some explanatory texts on larger screens.

plurals
  1. POissue with unrecognized selector sent to instance
    primarykey
    data
    text
    <p><strong>I'm using the master detail template.</strong></p> <p>Header file MasterViewController.h:</p> <pre><code>#import &lt;UIKit/UIKit.h&gt; //(Imported both MasterViewController.h and DetailViewController.h in implementation file of MasterViewController.m) @class DetailViewController; @interface MasterViewController : UITableViewController @property (strong, nonatomic) DetailViewController *detailViewController; -(void)createFlowerData; @end </code></pre> <p>Implementation file HeaderViewController.m:</p> <pre><code>@interface MasterViewController () { NSMutableArray *_objects; NSArray *_flowerData; NSArray *_flowerSections; } @end - (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view, typically from a nib. self.navigationItem.leftBarButtonItem = self.editButtonItem; UIBarButtonItem *addButton = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemAdd target:self action:@selector(insertNewObject:)]; self.navigationItem.rightBarButtonItem = addButton; self.detailViewController = (DetailViewController *)[[self.splitViewController.viewControllers lastObject] topViewController]; //invoking the method I implemented to give data to flowerData array [self createFlowerData]; } -(void)createFlowerData{ NSMutableArray *redFlowers; NSMutableArray *blueFlowers; redFlowers = [[NSMutableArray alloc] init]; blueFlowers = [[NSMutableArray alloc] init]; //create the 2 sections for the flowerSections array _flowerSections = @[@"Red Flowers", @"Blue Flowers"]; //add the objects to the mutable array //red flowers [redFlowers addObject:@{@"name":@"Poppy",@"picture":@"Poppy.png",@"url":@"http://en.wikiepdia.org/wiki/Poppy"}]; [redFlowers addObject:@{@"name":@"Tulip",@"picture":@"Tulip.png",@"url":@"http://en.wikipedia.org/wiki/Tulip"}]; [redFlowers addObject:@{@"name":@"Gerbera",@"picture":@"Gerbera.png",@"url":@"http://en.wikiepdia.org/wiki/Gerbera"}]; //blue flowers [blueFlowers addObject:@{@"name":@"Phlox",@"picture":@"Phlox.png",@"url":@"http:en.wikipedia.org/wiki/Gerbera"}]; [blueFlowers addObject:@{@"name":@"Pin Cushion Flower",@"picture":@"Pincushion flower.png",@"url":@"http://en.wikipedia.org/wiki/Scabious"}]; [blueFlowers addObject:@{@"name":@"Iris",@"picture":@"Iris.png",@"url":@"http://en.wikipedia.org/wiki/Iris_(plant)"}]; _flowerData = @[redFlowers, blueFlowers]; } - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { return [_flowerSections count]; } - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { //find the number of row elements in a given section of the flower Data array return [_flowerData[section] count]; } -(NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section{ //index 0 is the red flower //index 1 is the blue flower return _flowerSections[section]; } - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"flowerCell"]; cell.textLabel.text = _flowerData[indexPath.section][indexPath.row][@"name"]; cell.detailTextLabel.text = _flowerData[indexPath.section][indexPath.row][@"url"]; cell.imageView.image = _flowerData[indexPath.section][indexPath.row][@"picture"]; return cell; } </code></pre> <p>I then get the following when I build the application on the ios simulator(iPad):</p> <pre><code>2013-09-01 23:49:40.015 flowerDetail2[2394:c07] -[__NSCFConstantString _isResizable]: unrecognized selector sent to instance 0x6af4 2013-09-01 23:49:40.017 flowerDetail2[2394:c07] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSCFConstantString _isResizable]: unrecognized selector sent to instance 0x6af4' *** First throw call stack: (0x1c95012 0x10d2e7e 0x1d204bd 0x1c84bbc 0x1c8494e 0x4ca7ab 0x121ae9 0x2c1f 0xd18fb 0xd19cf 0xba1bb 0xcab4b 0x672dd 0x10e66b0 0x2291fc0 0x228633c 0x2291eaf 0x1062bd 0x4eb56 0x4d66f 0x4d589 0x4c7e4 0x4c61e 0x4d3d9 0x502d2 0xfa99c 0x47574 0x4776f 0x47905 0x8dceab6 0x50917 0x1496c 0x1594b 0x26cb5 0x27beb 0x19698 0x1bf0df9 0x1bf0ad0 0x1c0abf5 0x1c0a962 0x1c3bbb6 0x1c3af44 0x1c3ae1b 0x1517a 0x16ffc 0x1bed 0x1b15) libc++abi.dylib: terminate called throwing an exception (lldb) </code></pre> <p>(Please note that I did not include everything, just the parts I thought were important)</p> <p>This has been driving me crazy the whole day, I've checked multiple times, rewritten the whole thing and still the same result, I can't even get the cells to display. I googled, and I found something like it means that I'm sending a message to a method that doesn't know what to do with it, but I'm sure it's right? Could somebody please help me debug this!</p>
    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.
 

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