Kjuly / KYCircleMenu

An iOS UI control that allows you to build a circular menu by laying out buttons in a circle pattern adjusting from the number of buttons (1~6).
MIT License
786 stars 154 forks source link

Warning Error: Unused Entity Issue Expression result unused #4

Closed frank0ch0a closed 11 years ago

frank0ch0a commented 11 years ago

Hi Kaijie Yu, I copied the files of demo to new single view project, in iOS 6.1, I debugged the ARC errors, like memory release, but xcode showed me that warning error of the Designated Initializer in AppDelegate, I run the app and the simulator show me a black screen.

!Warning :Error: Unused Entity Issue Expression result unused

[circleMenuViewController initWithButtonCount:kKYCCircleMenuButtonsCount
                                                     menuSize:kKYCircleMenuSize
                                                    buttonSize:kKYCircleMenuButtonSize
                               buttonImageNameFormat:kKYICircleMenuButtonImageNameFormat
                                           centerButtonSize:kKYCircleMenuCenterButtonSize
                                centerButtonImageName:kKYICircleMenuCenterButton
               centerButtonBackgroundImageName:kKYICircleMenuCenterButtonBackground];
Kjuly commented 11 years ago

Hi @panchito, It's a Non-ARC lib, when you need to use this lib in an ARC enabled project, you need to add -fno-objc-arc flag for the lib.

Kjuly commented 11 years ago

Steps to add the -fno-objc-arc flag for using this lib in an ARC enabled project:

  1. Select the project target;
  2. Choose Build Phases;
  3. Click the little arrow beside the Compile Sources tab to expand the list of files;
  4. Find the "KYCircleMenu.m" by searching, and double click it to show a popup, add -fno-objc-arc as the Compiler Flags.
frank0ch0a commented 11 years ago

Ok, thanks a lot , but the warning above in the Designated Initializer " Unused Entity Issue Expression result unused " what it can be causing?, I imported all the files to their respective headers.

Kjuly commented 11 years ago

Have you set circleMenuViewController as the root view controller of nav? This warning shows that you didn't use the instance after you initialized it, and that's why it's black (blank actually). To silence the warning, you can put a

NSLog(@"%@", circleMenuViewController);

after it. But I think your view is still blank. So please make sure that your circleMenuViewController is set as the root view controller of the nav.

B.t.w., you don't need to import the demo into your own project, just import the folder of KYCircleMenu is fine. When you need to test the demo, just open the KYCircleMenuDemo/KYCircleMenuDemo.xcodeproj.

frank0ch0a commented 11 years ago

Yes ,I have set circleMenuViewController as the root view controller of nav, I only imported constants,KYCircleMenu and CircleMenuViewController , I'll be check all again.

thank you very much

Kjuly commented 11 years ago

Well, it seems I need to let the lib to support ARC some time later..

frank0ch0a commented 11 years ago

Hi Kaijie Yu

Attached, I send to you , the warning error, what is it wrong?

thanks

Captura de pantalla 2013-02-02 a la s 13 29 13

frank0ch0a commented 11 years ago

Hola Kaijie Yu I found the solution , I redefined the init of CircleMenuViewcontroller

// Circle Menu
CircleMenuViewController * circleMenuViewController=
[[CircleMenuViewController alloc]initWithButtonCount:kKYCCircleMenuButtonsCount
                                            menuSize:kKYCircleMenuSize
                                          buttonSize:kKYCircleMenuButtonSize
                               buttonImageNameFormat:kKYICircleMenuButtonImageNameFormat
                                    centerButtonSize:kKYCircleMenuCenterButtonSize
                               centerButtonImageName:kKYICircleMenuCenterButton
                     centerButtonBackgroundImageName:kKYICircleMenuCenterButtonBackground];

// Navigation Controller
UINavigationController * navigationController = [[UINavigationController alloc]initWithRootViewController:circleMenuViewController];
[navigationController.navigationBar setBarStyle:UIBarStyleBlackTranslucent];

// Set navigation controller as the root vc
[self.window setRootViewController:navigationController];

Thank you very much!

Kjuly commented 11 years ago

I see. Thank you!