小编Fra*_*ank的帖子

循环遍历枚举值

是否可以在Objective-C中循环枚举值?

c enums objective-c

36
推荐指数
5
解决办法
5万
查看次数

我们如何清除NSMutableData中的内容

如何在不使用release的情况下清除NSMutableData,然后再次重新分配/ init再次使用?我看着resetBytesInRange设置为零,但我不确定这一点.有人可以帮忙吗?

iphone objective-c nsdata

27
推荐指数
1
解决办法
2万
查看次数

如何将printf存储到变量中?

我想使用类似于C中printf所做的事情来存储格式化的字符串.

char *tmp = (char *)sqlite3_column_text(selectstmt, 2);
const char *sqlAnswers = printf("select key from answer WHERE key = %s LIMIT 5;", tmp);
Run Code Online (Sandbox Code Playgroud)

后者显然是一个错误.

c string string-formatting

17
推荐指数
3
解决办法
3万
查看次数

我们如何比较一个对象的2个类名

有没有办法在2个对象之间比较类名?

喜欢:

NSString *bla = [[NSString alloc] init];
if([bla class] isEqual: NSString])
 NSLog(@"success");
Run Code Online (Sandbox Code Playgroud)

不确定我的语法是否正确.

comparison class object objective-c

15
推荐指数
2
解决办法
2万
查看次数

在网格上旋转CGPoint的最佳方法是什么?

我想根据角度在屏幕上旋转CGPoint,旋转锚定在另一个点上.想知道最有效的方法是什么?

iphone math rotation

10
推荐指数
2
解决办法
7516
查看次数

UIButton在动画期间没有交互

我正在尝试为UIButton制作动画.但在动画期间,没有与UIButton的互动.预期的行为是能够在移动时单击按钮.这是UIButton和动画的代码片段:

UIImage *cloudImage = [UIImage imageNamed:@"sprite.png"];    
UIButton moveBtn = [UIButton buttonWithType:UIButtonTypeCustom];
[moveBtn setFrame:CGRectMake(0.0, 80.0, cloudImage.size.width, cloudImage.size.height)];
[moveBtn setImage:cloudImage forState:UIControlStateNormal];
[moveBtn addTarget:self action:@selector(hit:) forControlEvents:UIControlEventTouchUpInside];
[self.view addSubview:moveBtn];
CGPoint newLeftCenter = CGPointMake( 300.0f + moveBtn.frame.size.width / 2.0f, moveBtn.center.y);
[UIView beginAnimations:nil context:nil]; 
[UIView setAnimationDuration:5.0f];
[UIView setAnimationRepeatCount:HUGE_VALF];
moveBtn.center = newLeftCenter;
[UIView commitAnimations];
Run Code Online (Sandbox Code Playgroud)

hit选择器只显示一个NSLog,以显示按钮是否响应它.任何帮助,将不胜感激.

iphone core-animation uibutton caanimation

10
推荐指数
2
解决办法
5862
查看次数

我们如何获得活动的主题?

我试图检测用于活动的主题,但到目前为止我只能找到整个应用程序的主题?有没有办法做到这一点?

android themes android-activity

10
推荐指数
2
解决办法
8823
查看次数

Is there a way to use a custom selected image for UITabBarItem?

I like to have a custom selected image when a user selects an item on the tab bar, by default it selects as blue like but would like to have a green color instead. something like below any thoughts?

alt text http://www.freeimagehosting.net/uploads/11a2137011.png

iphone uitabbaritem uitabbar

8
推荐指数
2
解决办法
9463
查看次数

ASIHTTPRequest vs NSURLConnection

只是想知道哪个在性能和可用性方面更快?或者如果那里有更好的东西?

iphone nsurlconnection asihttprequest

8
推荐指数
2
解决办法
5567
查看次数

removeObject是否释放对象的NSMutableArray中的对象?

我想知道如果删除对象被正确处理,何时使用数组中的removeObject删除对象.被删除的对象会被释放吗?

iphone cocoa-touch objective-c

7
推荐指数
2
解决办法
5410
查看次数