아이폰어플개발정보2010. 10. 23. 14:51
[아이폰 앱 개발] warning: X may not reposnd to Y 관련
Originally Posted by occular 
I'm just wondering what the usual way is of fixing "warning: X may not reposnd to Y" warnings?

I can see what the problem is, just not sure of the best way to fix it...
This is a method in a controller of mine that subclasses UIViewController:

- (void)viewWillAppearBOOL)animated {
[[self view] setupAnimation];
}

The '[self view]' gives us the "UIView view" field inherited from UIViewController, and the compiler of course can't tell that the UIView in question responds to the setupAnimation message.

So what is the best way to fix this situation?
Would adding a selector check be the way forward?

thanks!
Ok, so it turns out that plain old casting is fine as the solution:

[(MyView*)[self view] setupAnimation];

For some reason I got it into my head that casting wasn't the objective c 'way' or something, but apparently that is not the case!
Posted by 오늘마감

댓글을 달아 주세요

아이폰어플개발정보2010. 6. 24. 11:37
Do not use NSLog in Release configuration

by alex 11. 5월 2009 11:59
//You need o put this code into *_Prefix.pch

#ifdef DEBUG

#define DLog(...) NSLog(__VA_ARGS__)

#else

#define DLog(...) /* */

#endif

#define ALog(...) NSLog(__VA_ARGS__)

 
//In build options you need to add -DDEBUG to the Other C Flags for "Debug" configuration

//Note -- this options appears only for Device *.* configuration

//Last step -- replace NSLog with DLog enywhere you want to hide NSLog output on release build



출처 : http://blog.naver.com/PostView.nhn?blogId=amoros21&logNo=140107111242
Posted by 오늘마감

댓글을 달아 주세요