Discussion Forums  >  Xcode, Errors, Installing, Configuring

Replies: 31    Views: 223

AussieRyan
Aspiring developer
Profile
Posts: 148
Reg: Mar 21, 2012
Margate, QLD Au...
1,480
01/12/14 04:14 AM (10 years ago)

FIXED: BT_contextMenu build errors

I have just downloaded the files for a project into Xcode. (latest self hosted, latest plugin versions, etc) When I build, I get 5 errors starting at line 56 in this section of code: //mask entire screen with a subview... self.mask = [[UIView alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; self.mask.autoresizingMask = (UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight); [self.mask setBackgroundColor:[UIColor blackColor]]; [self.mask setAlpha:.25]; //add the mask as a subView... [self.view addSubview:self.mask]; error states: Property 'mask' not found on object of type 'BT_contextMenu *' It appears that this file has been changed from a previous version in app I downloaded a few days ago? The code is different and I am not up to speed to try and change anything. EDIT: If I add the code from the earlier version of the file: //mask entire screen UIView *mask = [[UIView alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; [mask setBackgroundColor:[UIColor blackColor]]; mask.autoresizingMask = (UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleRightMargin); [mask setAlpha:.25]; [self.view addSubview:mask]; and comment out the error it builds EDIT: Tried to run in simulator and get error in file appname_appDelegate.m at Line 546: //make mask and menu in context view full size... [self.contextMenu.mask setFrame:theNavController.view.bounds]; [self.contextMenu.menuTable setFrame:theNavController.view.bounds]; error states: Property 'mask' not found on object of type 'BT_contextMenu *' (same error message) UPDATE: fix for this below. Well done @chris1
 
Blue
Apple Fan
Profile
Posts: 24
Reg: Jun 20, 2011
Gainesville, Fl...
4,990
like
01/12/14 08:46 AM (10 years ago)
I am having the same problem under the same download conditions"(latest self hosted, latest plugin versions, etc)". Hope this help! Blue
 
Red Dog
buzztouch Evangelist
Profile
Posts: 805
Reg: Jun 16, 2011
Southern Califo...
18,800
like
01/12/14 11:22 AM (10 years ago)
You are not alone' This is now happening to a project that was working perfectly last week. The BT_contextMenu.m code has changed in both self hosted and BT.com over night?
 
Jake Chasan
Veteran developer
Profile
Posts: 1685
Reg: May 13, 2011
location unknow...
29,650
like
01/12/14 12:45 PM (10 years ago)
Does anyone have an example of what the BT context menu looks like? Jake
 
Red Dog
buzztouch Evangelist
Profile
Posts: 805
Reg: Jun 16, 2011
Southern Califo...
18,800
like
01/12/14 01:22 PM (10 years ago)
HI Jake. It's in the BT 3.0 / BT_Core folder
 
Red Dog
buzztouch Evangelist
Profile
Posts: 805
Reg: Jun 16, 2011
Southern Califo...
18,800
like
01/12/14 01:30 PM (10 years ago)
 
Jake Chasan
Veteran developer
Profile
Posts: 1685
Reg: May 13, 2011
location unknow...
29,650
like
01/12/14 01:31 PM (10 years ago)
These are problems with the properties not being declared in the .h file. Jake
 
shenry
Aspiring developer
Profile
Posts: 469
Reg: Jan 10, 2012
Orange County, ...
13,390
like
01/12/14 02:17 PM (10 years ago)
ackkk. It got me too. I need to learn to search the forum before I spend 3 hours re-downloading source code and poking around. Any idea how to fix? http://s30.postimg.org/hpqkd998x/Screen_Shot_2014_01_12_at_1_13_01_PM.png
 
chris1
Code is Art
Profile
Posts: 3862
Reg: Aug 10, 2012
Austin, TX
50,120
like
01/12/14 02:38 PM (10 years ago)
Here's an updated .h file that you can include in your projects to fix the errors. Delete the old one from Xcode, and drag this one in. https://www.dropbox.com/s/kgg5f4xqeutzi5s/BT_contextMenu.h
 
shenry
Aspiring developer
Profile
Posts: 469
Reg: Jan 10, 2012
Orange County, ...
13,390
like
01/12/14 02:45 PM (10 years ago)
That worked for me. Thanks Chris, way to be - putting out fires on a Sunday.
 
Jake Chasan
Veteran developer
Profile
Posts: 1685
Reg: May 13, 2011
location unknow...
29,650
like
01/12/14 03:36 PM (10 years ago)
@Chris: Do you know if the core will be updated soon (to suppress the iAd warnings, resolve the view controller problems, and fix the context menu) Jake
 
Wisertime
Aspiring developer
Profile
Posts: 22
Reg: Jun 15, 2012
Vancouver
4,020
like
01/12/14 04:16 PM (10 years ago)
I rippin my hair out over this!!
 
Wisertime
Aspiring developer
Profile
Posts: 22
Reg: Jun 15, 2012
Vancouver
4,020
like
01/12/14 04:19 PM (10 years ago)
I rippin my hair out over this!!
 
Wisertime
Aspiring developer
Profile
Posts: 22
Reg: Jun 15, 2012
Vancouver
4,020
like
01/12/14 04:20 PM (10 years ago)
I rippin my hair out over this!!
 
chris1
Code is Art
Profile
Posts: 3862
Reg: Aug 10, 2012
Austin, TX
50,120
like
01/12/14 04:29 PM (10 years ago)
@Jake - not sure. @Wisertime - what are you having problems with? Did you copy in the file I posted?
 
Wisertime
Aspiring developer
Profile
Posts: 22
Reg: Jun 15, 2012
Vancouver
4,020
like
01/12/14 04:47 PM (10 years ago)
i tried with no luck. I'm sure it me. Is it a problem with the package download? should I just wait for it to fix itself? or do you think this error is going to stick around for a while>
 
Wisertime
Aspiring developer
Profile
Posts: 22
Reg: Jun 15, 2012
Vancouver
4,020
like
01/12/14 04:48 PM (10 years ago)
not to mention... Xcode 5 is all different. trying to remain calm ;)
 
chris1
Code is Art
Profile
Posts: 3862
Reg: Aug 10, 2012
Austin, TX
50,120
like
01/12/14 05:21 PM (10 years ago)
Not sure how long it will be before it's fixed - hopefully not long. But copying the file I sent should have fixed it. Are you sure you're having the same errors? Can you post a screenshot of the errors?
 
othmane
Apple Fan
Profile
Posts: 105
Reg: Feb 08, 2012
Casablanca
1,050
like
01/13/14 03:03 PM (10 years ago)
That worked for me. Thanks Chris
 
shenry
Aspiring developer
Profile
Posts: 469
Reg: Jan 10, 2012
Orange County, ...
13,390
like
01/13/14 06:39 PM (10 years ago)
@Wisertime just checking to see if you are replacing the .m file, not coping the contexts from the new .m file and pasting into your .m file. When I copied and pasted, it didn't work. But when I replaced the file in my project with the file downloaded from dropbox it did work.
 
Uelsimon
Lost but trying
Profile
Posts: 272
Reg: Mar 25, 2012
NYC
4,470
like
01/13/14 07:09 PM (10 years ago)
worked for me too. 1. select old file, right click + choose Delete 2. Choose 'Move to trash' 3. drag new file in place where old one was 4. Ensure it copies to the project 5. clean the project (command+K+(shift?) 6. build ... 7. contextmenu Error should be gone.
 
Wisertime
Aspiring developer
Profile
Posts: 22
Reg: Jun 15, 2012
Vancouver
4,020
like
01/13/14 08:06 PM (10 years ago)
Yup got it to work! Thanks everyone.
 
Jen
Lost but trying
Profile
Posts: 70
Reg: Mar 14, 2013
Melbourne
2,750
like
01/16/14 04:20 AM (10 years ago)
Hi everyone, I'm having the same problem, but am not a coder...so this is really stretching my brain. I used the .h replacement (deleted old, then copy and pasted) kindly supplied by Chris and then cleaned and saved it. That worked until the next time I did another build. Now it shows the error with the .m file. I saw that I'm not meant to copy and paste, but where do I delete/add in the new file? I am seriously reluctant to mess around here. Can someone pretty please have a look at the code below and tell me what's going on? I am consuming way too much coffee late at night trying to work this thing through ;) I apologize for the show of ignorance and appreciate your help. Thanks heaps, Jen #import <UIKit/UIKit.h> #import "BT_contextMenu.h" @implementation BT_contextMenu @synthesize menuData, menuItems, menuTable; -(id)initWithMenuData:(BT_item *)theMenuData{ if((self = [super init])){ [BT_debugger showIt:self message:[NSString stringWithFormat:@"INIT %@", @""]]; //this screen wants a full screen layout... self.wantsFullScreenLayout = YES; //set menu data... [self setMenuData:menuData]; //set the frame for the view... [self.view setFrame:[[UIScreen mainScreen] bounds]]; self.view.autoresizingMask = (UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight); [self.view setUserInteractionEnabled:TRUE]; //mask entire screen with a subview... self.mask = [[UIView alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; self.mask.autoresizingMask = (UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight); [self.mask setBackgroundColor:[UIColor blackColor]]; [self.mask setAlpha:.25]; //add the mask as a subView... [self.view addSubview:self.mask]; //table layout options... int tableRowHeight = 30; //table size depends on device, it's updated in the loadData method... menuTable = [[UITableView alloc] initWithFrame:[[UIScreen mainScreen] bounds] style:UITableViewStylePlain]; [menuTable setRowHeight:tableRowHeight]; [menuTable setBackgroundColor:[UIColor whiteColor]]; [menuTable setSectionHeaderHeight:0]; [menuTable setShowsVerticalScrollIndicator:FALSE]; [menuTable setShowsHorizontalScrollIndicator:FALSE]; [menuTable setDataSource:self]; [menuTable setDelegate:self]; //ios7 doens't extend separator to left edge for each row. Lame! if([menuTable respondsToSelector:@selector(setSeparatorInset:)]){ [menuTable setSeparatorInset:UIEdgeInsetsZero]; } //add the table as a sub-view... [self.view addSubview:menuTable]; } return self; } //loadData... -(void)loadData{ [BT_debugger showIt:self theMessage:@"loadData"]; //init the items array self.menuItems = [[NSMutableArray alloc] init]; //fill using childItems in menuData... if([[self.menuData jsonVars] objectForKey:@"childItems"]){ NSArray *tmpMenuItems = [[self.menuData jsonVars] objectForKey:@"childItems"]; for(NSDictionary *tmpMenuItem in tmpMenuItems){ BT_item *thisMenuItem = [[BT_item alloc] init]; thisMenuItem.itemId = [tmpMenuItem objectForKey:@"itemId"]; thisMenuItem.itemType = [tmpMenuItem objectForKey:@"itemType"]; thisMenuItem.jsonVars = tmpMenuItem; [self.menuItems addObject:thisMenuItem]; } } //add the cancel item at the end... BT_item *cancelItem = [[BT_item alloc] init]; [cancelItem setItemId:@"na"]; [cancelItem setItemType:@"BT_menuItem"]; //create a dictionary for the dynamic screen. NSDictionary *dict = [NSDictionary dictionaryWithObjectsAndKeys: @"na", @"itemId", @"BT_menuItem", @"itemType", @"Cancel", @"titleText", nil]; [cancelItem setJsonVars:dict]; [self.menuItems addObject:cancelItem]; //add a blank item at end so the last element shows the bottom separator... BT_item *blankItem = [[BT_item alloc] init]; [blankItem setItemId:@"na"]; [blankItem setItemType:@"BT_menuItem"]; //create a dictionary for the dynamic screen. NSDictionary *dict2 = [NSDictionary dictionaryWithObjectsAndKeys: @"na", @"itemId", @"BT_menuItem", @"itemType", @"", @"titleText", nil]; [blankItem setJsonVars:dict2]; [self.menuItems addObject:blankItem]; //refresh table... [self.menuTable reloadData]; } //touchesBegan... -(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event{ [BT_debugger showIt:self message:[NSString stringWithFormat:@"touchesBegan%@", @""]]; //app delegate getreviewed_appDelegate *appDelegate = (getreviewed_appDelegate *)[[UIApplication sharedApplication] delegate]; [appDelegate hideContextMenu]; } ////////////////////////////////////////////////////////////// //UITableView delegate methods - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { return 1; } // number of rows - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { return [self.menuItems count]; } //table view cells - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { NSString *CellIdentifier = [NSString stringWithFormat:@"cell_%i", indexPath.row]; UITableViewCell *cell = (UITableViewCell *)[tableView dequeueReusableCellWithIdentifier:CellIdentifier]; if (cell == nil){ //init our custom cell cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier]; cell.accessoryType = UITableViewCellAccessoryNone; } //this menu item... BT_item *thisMenuItemData = [self.menuItems objectAtIndex:indexPath.row]; NSString *title = [BT_strings getJsonPropertyValue:thisMenuItemData.jsonVars nameOfProperty:@"titleText" defaultValue:@""]; [cell.textLabel setText:title]; //set cell font... UIFont *rowFont = [UIFont fontWithName: @"Helvetica" size: 11.0]; cell.textLabel.font = rowFont; //set cell selection color... [cell setSelectionStyle:UITableViewCellSelectionStyleGray]; //return return cell; } //on row select - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { [BT_debugger showIt:self theMessage:[NSString stringWithFormat:@"didSelectRowAtIndexPath: Selected Row: %i", indexPath.row]]; //appDelegate getreviewed_appDelegate *appDelegate = (getreviewed_appDelegate *)[[UIApplication sharedApplication] delegate]; //pass this menu item to the tapForMenuItem method BT_item *thisMenuItem = [self.menuItems objectAtIndex:indexPath.row]; if([thisMenuItem jsonVars] != nil){ //get possible itemId of the screen to load NSString *loadScreenItemId = [BT_strings getJsonPropertyValue:thisMenuItem.jsonVars nameOfProperty:@"loadScreenWithItemId" defaultValue:@""]; //get possible nickname of the screen to load NSString *loadScreenNickname = [BT_strings getJsonPropertyValue:thisMenuItem.jsonVars nameOfProperty:@"loadScreenWithNickname" defaultValue:@""]; //bail if load screen = "none" if([loadScreenItemId isEqualToString:@"none"]){ return; } //check for loadScreenWithItemId THEN loadScreenWithNickname THEN loadScreenObject BT_item *screenObjectToLoad = nil; if([loadScreenItemId length] > 1){ screenObjectToLoad = [appDelegate.rootApp getScreenDataByItemId:loadScreenItemId]; }else{ if([loadScreenNickname length] > 1){ screenObjectToLoad = [appDelegate.rootApp getScreenDataByNickname:loadScreenNickname]; }else{ if([thisMenuItem.jsonVars objectForKey:@"loadScreenObject"]){ screenObjectToLoad = [[BT_item alloc] init]; [screenObjectToLoad setItemId:[[thisMenuItem.jsonVars objectForKey:@"loadScreenObject"] objectForKey:@"itemId"]]; [screenObjectToLoad setItemNickname:[[thisMenuItem.jsonVars objectForKey:@"loadScreenObject"] objectForKey:@"itemNickname"]]; [screenObjectToLoad setItemType:[[thisMenuItem.jsonVars objectForKey:@"loadScreenObject"] objectForKey:@"itemType"]]; [screenObjectToLoad setJsonVars:[thisMenuItem.jsonVars objectForKey:@"loadScreenObject"]]; } } } //load next screen if it's not nil if(screenObjectToLoad != nil){ //hide table... [appDelegate hideContextMenu]; //load screen... BT_viewController *parentScreen = [appDelegate getViewController]; [parentScreen loadScreenObject:screenObjectToLoad]; }else{ //hide table... [appDelegate hideContextMenu]; } }else{ //hide table... [appDelegate hideContextMenu]; } } //viewForFooterInSection... -(UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section{ UIView *view = [[UIView alloc] init]; return view; } @end
 
AussieRyan
Aspiring developer
Profile
Posts: 148
Reg: Mar 21, 2012
Margate, QLD Au...
1,480
like
01/16/14 04:32 AM (10 years ago)
In BT_Core > BT_contextMenu.h add: @property (nonatomic, retain) UIView *mask; under the other @property entries
 
Jen
Lost but trying
Profile
Posts: 70
Reg: Mar 14, 2013
Melbourne
2,750
like
01/17/14 05:40 AM (10 years ago)
Hi AussieRyan, Thanks! That worked brilliantly. Is there any way to save it so that i don't have to re-insert the code each build? I tried the obvious and selected 'save', but the problem was back the next time I did another build. Not sure if you can answer my next question...while the build is technically a success, the iOS simulator comes up blank, saying "Missing Plugin: The view controller for this plugin was not compiled in the Xcode project". I am using the menu with Image advanced plugin. Thanks heaps! Jen
 
Jake Chasan
Veteran developer
Profile
Posts: 1685
Reg: May 13, 2011
location unknow...
29,650
like
01/17/14 07:49 AM (10 years ago)
@Jen: Did you drag the folder, BT_Plugins, into Xcode? Jake
 
Jen
Lost but trying
Profile
Posts: 70
Reg: Mar 14, 2013
Melbourne
2,750
like
01/18/14 04:52 AM (10 years ago)
Hi Jake, Yes I did. -Jen
 
chris1
Code is Art
Profile
Posts: 3862
Reg: Aug 10, 2012
Austin, TX
50,120
like
01/18/14 09:04 AM (10 years ago)
Every time you download source code, you'll need to do this, but not every time you 'build' (clicking run in Xcode forces a build). David will be back soon and will get this fixed.
 
ianJamesPiano
Code is Art
Profile
Posts: 2661
Reg: Feb 13, 2011
Palm Springs, C...
37,010
like
01/20/14 08:52 PM (10 years ago)
Nice fix thanks!
 
Art_Malik
I hate code!
Profile
Posts: 42
Reg: Jun 16, 2011
Los Angeles
1,220
like
01/21/14 03:30 PM (10 years ago)
AussieRyan.......! Thank you so much as that simple trick worked for me too!
 
Becky
I hate code!
Profile
Posts: 269
Reg: Aug 08, 2012
NYC
6,140
like
01/21/14 06:05 PM (10 years ago)
I tried this fix and I am getting five errors afterwards: 1 - Semantic Issue Duplicate interface definition for class 'BT_contextMenu' and 4 - Semantic Issue Property has a previous declaration. Any ideas?
 
Becky
I hate code!
Profile
Posts: 269
Reg: Aug 08, 2012
NYC
6,140
like
01/21/14 06:31 PM (10 years ago)
Nevermind. I did a clean and build repeatedly until those errors went away. Persistence always prevails...
 

Login + Screen Name Required to Post

pointerLogin to participate so you can start earning points. Once you're logged in (and have a screen name entered in your profile), you can subscribe to topics, follow users, and start learning how to make apps like the pros.