ios - Cannot specify setter 'setTitle:' for properties of NSObject or WKInterfaceController -
i trying set wkinterfacetable. followed apples docs. label not getting text , error message in console:
cannot specify setter 'settitle:' properties of nsobject or wkinterfacecontroller
how can fix this? objective-c please. here s code:
.h
#import <foundation/foundation.h> #import <watchkit/watchkit.h> @interface mainrowtype : nsobject @property (strong, nonatomic) iboutlet wkinterfaceimage *image; @property (strong, nonatomic) iboutlet wkinterfacelabel *title; @end
.m
#import "mainrowtype.h" @implementation mainrowtype @end
.h
#import <watchkit/watchkit.h> #import <foundation/foundation.h> #import "mainrowtype.h" @interface watchtablecontroller : wkinterfacecontroller @property (strong, nonatomic) iboutlet wkinterfacetable *tableview; @property (strong, nonatomic) nsmutablearray *titlearray; @end
.m
i call method
- (void)configuretablewithdata:(nsmutablearray*)dataobjects { [self.tableview setnumberofrows:[dataobjects count] withrowtype:@"mainrowtype"]; (nsinteger = 0; < self.tableview.numberofrows; i++) { mainrowtype* therow = [self.tableview rowcontrolleratindex:i]; nsstring *titlestring = [dataobjects objectatindex:i]; [therow.title settext:titlestring]; } }
thanks
your title
property problem. can't name property "title" in classes. change property name , should set.
Comments
Post a Comment