I have just run across a strange error in the real-time compiler. I have a class with an instance variable “coursePopupButton” declared:
@outlet CPPopUpButton coursePopupButton;
But here:
- (void)windowDidLoad
{
[super windowDidLoad];
// set popup
var courseList = [[[_delegate profileResource] trainerCourses] sortedArrayUsingDescriptors:[CPArray arrayWithObject:[CPSortDescriptor sortDescriptorWithKey:"courseName" ascending:YES]]];
[coursePopUpButton removeAllItems];
for (var i=0; i<[courseList count]; i++)
{
var row = [courseList objectAtIndex:i];
var item = [[CPMenuItem alloc] initWithTitle:[row name] action:nil keyEquivalent:nil];
[item setTag:[row trainerCourseID]];
[item setRepresentedObject:row];
[coursePopUpButton addItem:item];
}
I get the error:
WARNING line 63 in
http://localhost:8888/CERTS/LMSCourseReportWindowController.j: Using unknown class or uninitialized global variable ‘coursePopUpButton'
on both occurrences of coursePopUpButton.
But I don’t get it anywhere else, and there are three more uses of the ivar in that file. Sure enough, the compiled versions show:
(coursePopUpButton == null ? null : coursePopUpButton.isa.objj_msgSend0(coursePopUpButton, "removeAllItems"));
and
(coursePopUpButton == null ? null : coursePopUpButton.isa.objj_msgSend1(coursePopUpButton, "addItem:", item));
But in other occurrences:
((___r1 = self.coursePopupButton), ___r1 == null ? null : ___r1.isa.objj_msgSend1(___r1, "selectItemWithTag:", (dataModel == null ? null : dataModel.isa.objj_msgSend0(dataModel, "trainerCourseID"))));
and
var course = ((___r1 = ((___r2 = self.coursePopupButton), ___r2 == null ? null : ___r2.isa.objj_msgSend0(___r2, "selectedItem"))), ___r1 == null ? null : ___r1.isa.objj_msgSend0(___r1, "representedObject"));
Any reason for this?
Keary Suska
Esoteritech, Inc.
"Demystifying technology for your home or business"