-
Notifications
You must be signed in to change notification settings - Fork 255
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Two warnings when building using XCode 7 Beta 5 #87
Comments
I am getting the same issue. Had you figured this one out yourself by any chance? |
I didn't really try to handle these warnings as they are harmless. I am also sure that this issue will be targeted by the project owner when he will get to it. |
I just checked and this warning doesn't occur with the HEAD version of CHCSVParser. |
Definitely still getting these warnings with the latest code on the master branch today. They are the only warnings in my project. It would be very nice to have them fixed. |
You're right. This is occurring with Xcode 7. A related warning with Xcode 6.4 was fixed by moving to HEAD. |
This SO link seems to explain what's causing the warning (http://stackoverflow.com/a/24565513/45813). If you are very concerned about removing the warnings your best option now is to suppress them:
You could do turn it off on a per file basis as well as the link explains |
You can disable the warnings by a adding this at the top of your CHCSV.m and CHCSV.h files just before @interface. #ifdef __IPHONE_8_0 |
Dave has recently checked in changes to a 3.0.0 branch of this project. The 3.0.0 version is Swift-based and doesn't have this warning. |
I'm having this same issue on Xcode 7.2 . I'm on the latest objective c Branch. |
This warning appears since the designated initializer of the super class (NSObject > init) is not implemented in CHCSVParser and CHCSVWriter classes. The reason it's not implemented is that the library creator wished us the developers to use only the designated and convenience initializers defined in these classes. In my own code I use the following approach in similar cases:
This way, warnings are gone, calling to the init initializer will generate a compile time error, and getting somehow to the init initializer method bypassing the compiler error (maybe by dynamic dispatch) will generate a runtime exception. Any thoughts? |
Hi yoasha, |
It doesn't make a lot of sense... please try the following just to see what is wrong: In the CHCSVParser.h remove the following code that I previously asked to add: In the CHCSVParser.m, replace the code that I previously suggested with the following one:
Let me know if there are any warnings for the CHCSVParser class |
Hi yoasha, using the same idea I added I like your idea to add some alert to avoid the programmer trying to initialize using init. Maybe returning nil. Xcode asks to call self anyway, so I ended with this. `-(instancetype)init {
} |
Very interesting. In my code, I don't need to add the following line (just before the exception code) in order to prevent the warning: Having just the NSException code did the work for me. I am not sure why, but maybe it's related to the warning level preferences in Xcode which might be different in our dev environments. BTW, after adding your code to the implementation file that prevented the warnings, did you try to add again the following line to the h file? This line should be very useful as it prevents calling this initializer at compile time rather than runtime. |
Hi yoasha, good news! I didn't try before to just add I asked this same question on stackoverflow http://stackoverflow.com/questions/38044609/chcsvparser-warnings-how-to-solve-this-one, without answer. Would you like to answer this question with the help you give me? My english is really poor, and you guide me find the right solution. I really thank you for helping so much. |
Hi, I'm glad this helped. @davedelong (or any user with admin rights), what do you think about this solution? I can submit a pull request if you find this solution legit. |
I realize that these warnings are not affecting the functionality... However, it would be really nice having zero warnings in my project.
Thank you for this great project!
The text was updated successfully, but these errors were encountered: