I\'m getting a warning about a semantic issue pertaining to passing a *const _strong to type id and cannot seem to fix it no matter what I change.<
If you only want to switch views, you might want to try the code below. It works for me.
ProductsViewController *controller = [[ProductsViewController alloc] initWithNibName:@"Products" bundle:nil];
[self.navigationController pushViewController:controller animated:YES];
I used that to have my main menu in my app switch over to the game.
If you want a special animation (I think I saw Cross Dissolve?), however, I have no idea. I will try digging through the documentation to see, and I will tell you what I find.
As for the "*const_string to type id", although I don't know what you are trying to do with your app, I think the problem is the id <ProductsViewControllerDelegate> delegate in your view controller.
Got the same error when i tried to set the delegate of a UINavigationController to an object that implemented the wrong protocol (UINavigationBarDelegate instead of UINavigationControllerDelegate). This might be a simple typo.
This warning is oddly worded, but it is actually just a way of telling you that the class of self (whatever that class is) fails to conform to the ProductsViewControllerDelegate protocol. To get rid of the warning, you have two choices:
Declare the class of self (whatever that class is), in its @interface statement, to conform to the protocol ProductsViewControllerDelegate:
@interface MyClass : NSObject <ProductsViewControllerDelegate>;
Suppress the warning by changing this:
controller.delegate = self;
to this:
controller.delegate = (id)self;
The delegate property is typed as id<ProductsViewControllerDelegate>. But self is not. Under ARC you must make the cast explicit, so that the types formally agree. (I believe this is so that ARC can make absolutely certain it has sufficient information to make correct memory management decisions.)