我观察到Android程序员使用LogCat来查看彩色的Debugger Console输出.看起来你可以让不同的类以不同的颜色进行调试输出.在开发iPhone时这可能吗?
看看你对这行代码的看法:
if ([pickerViewController.picker.bvc.currentResolve.name isEqualToString:message])
...
Run Code Online (Sandbox Code Playgroud)
你会认为这是过度使用点运算符吗?
如果没有,我可以保持原样.
但如果是这样,那么首选的替代方案是什么?
我正在使用Objective-C编写iPhone应用程序.
这是Xcode给我的错误:
error: assignment of read-only variable 'prop.149'
Run Code Online (Sandbox Code Playgroud)
代码:
// Create CATransition object
CATransition *transition = [CATransition animation];
// Animate over 3/4 of a second
transition.duration = 0.75;
// using the ease in/out timing function
transition.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut];
// Set transition type
transition.type = kCATransitionPush;
// Next line gives error: assignment of read-only variable 'prop.149'
transition.subtype = (flipsideView.hidden == YES ? kCATransitionFromRight : kCATransitionFromLeft);
Run Code Online (Sandbox Code Playgroud)
错误意味着什么,我该如何解决?
这是我的Game类的构造函数:
// Construct a Game to be played with player on a copy of the board b.
Game(const Board& b, Player* player)
{
...
}
Run Code Online (Sandbox Code Playgroud)
这是我使用构造函数的方式:
Player p("Player Name");
Board b(6,3);
Game g(b, &p);
Run Code Online (Sandbox Code Playgroud)
这是如何运作的?被复制了吗?
如果我想保存指向播放器的指针,我应该创建如下的私有ivar吗?
private:
Player* _player;
...
// In Game constructor
_player = player;
Run Code Online (Sandbox Code Playgroud) 这个phpinfo()演示了这个问题.
我正在向URL传递一个查询字符串:
?qwerty=asdfg
Run Code Online (Sandbox Code Playgroud)
因此,我希望它列出这两个PHP变量:
_REQUEST["qwerty"] asdfg
_GET["qwerty"] asdfg
Run Code Online (Sandbox Code Playgroud)
还有这个查询字符串:
_SERVER["QUERY_STRING"] qwerty=asdfg
Run Code Online (Sandbox Code Playgroud)
但是,它不起作用.似乎根本没有设置这些变量.
我正在使用lighttpd.这可能与问题有关,也可能与此无关,但我的greengar.com-lighttpd.conf看起来像这样,因为我在大多数域名网页上使用WordPress:
### Generated by Elliot
### Wordpress: http://www.greengar.com
url.rewrite += (
"^/(wp-.+).*/?" => "$0",
"^/(blog/wp-.+).*/?" => "$0",
"^/(.*.php)" => "$0",
"^/(.*.pdf)" => "$0",
"^/(.*.png)" => "$0",
"^/(.*.html)" => "$0",
"^/(.*.ico)" => "$0",
"^/(.*.gif)" => "$0",
"^/(.*.txt)" => "$0",
"^/(images).*/?" => "$0",
"^/(sitemap.xml)" => "$0",
"^/(xmlrpc.php)" => "$0",
"^/(.+)/?$" => "/index.php/$1"
)
Run Code Online (Sandbox Code Playgroud)
同样,我不确定这是否与问题有关.
我的问题是:为什么PHP看不到查询字符串?
我该如何解决?
这是一个普通的phpinfo(),可以成功查看查询字符串.这是在运行Apache的其他服务器上运行的.
这是我用来加载纹理的代码.图像是CGImageRef.使用此代码加载图像后,我最终使用glDrawArrays()绘制图像.
size_t imageW = CGImageGetWidth(image);
size_t imageH = CGImageGetHeight(image);
size_t picSize = pow2roundup((imageW > imageH) ? imageW : imageH);
GLubyte *textureData = (GLubyte *) malloc(picSize * picSize << 2);
CGContextRef imageContext = CGBitmapContextCreate( textureData, picSize, picSize, 8, picSize << 2, CGImageGetColorSpace(image), kCGImageAlphaNoneSkipLast | kCGBitmapByteOrder32Big );
if (imageContext != NULL) {
CGContextDrawImage(imageContext, CGRectMake(0.0, 0.0, (CGFloat)imageW, (CGFloat)imageH), image);
glGenTextures(1, &textureId);
glBindTexture(GL_TEXTURE_2D, textureId);
// when texture area is small, bilinear filter the closest mipmap
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
// when texture area is large, …Run Code Online (Sandbox Code Playgroud) iphone ×3
objective-c ×2
xcode ×2
c++ ×1
class ×1
coding-style ×1
colors ×1
console ×1
constructor ×1
debugging ×1
oop ×1
opengl-es ×1
parameters ×1
php ×1
pointers ×1
query-string ×1