I create a UIView that is connected to a UITableView containing a list of store items, and is populated with an array of data that is associated with an object class (shopObjects).
here is my object H store objects -
The object of the store. M file
#import "shopObjects.h" @implementation shopObjects -(id)initWithshopITitle:(NSString *)shopITitleD shopIGroup:(NSString *)shopIGroupD shopIDesc:(NSString *)shopIDescD shopIPrice:(NSString *)shopIPriceD offer:(Boolean )offerD{ self= [super init]; if(self){ self.shopITitle = shopITitleD; self.shopIGroup = shopIGroupD; self.shopIDesc = shopIDescD; self.shopIPrice = shopIPriceD; self.offer = (offerD); } return self; } @end
This is my .h file controller.
and the VC.m file -
#import "shopVCViewController.h" @interface shopVCViewController () @end @implementation shopVCViewController - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil { self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]; if (self) { // Custom initialization } return self; } - (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view. //Set Scroller [self.shopScroll setScrollEnabled:YES]; [self.shopScroll setContentSize:CGSizeMake(320, 1100)]; self.title = @"Shop"; self.shopArray = [NSArray arrayWithObjects:@"1 x PT session - Β£25",@"3 for 2 PT sessions - Β£50 ",@"1 x Running Club - Β£15",@"1 x PT session", nil]; } - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { return 1; } - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { return [self.shopArray count]; } -(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *CellIdentifier =@ "Cell"; UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier forIndexPath:indexPath]; cell.textLabel.text=[self.shopArray objectAtIndex:indexPath.row]; return cell; } - (void)didReceiveMemoryWarning { [super didReceiveMemoryWarning]; // Dispose of any resources that can be recreated. } @end
I am trying to associate labels / text fields with the corresponding object variables, but the object or related shopObjects / objects are not displayed in the predictive text, and I get the following property: no error was found - I have no idea why! Can someone offer some advice please?

source share