您的位置:首页 > 移动开发 > Objective-C

From the documentation of -[NSArray indexOfObjectIdenticalTo:]

2013-02-01 15:05 465 查看
From the documentation of
-[NSArray indexOfObjectIdenticalTo:]
:


Return Value

The lowest index whose corresponding array value is identical to anObject. If none of the objects in the array is identical to anObject, returns
NSNotFound
.


and
NSNotFound
is defined as:

enum{NSNotFound=NSIntegerMax};

and 2147483647 = 0x7fffffff is the maximum integer in iOS.

//buttonId is NSArray
- (void)eventTouchObserved:(id)sender
{
UIButton *touchedButton = [buttonId objectAtIndex:[buttonId indexOfObjectIdenticalTo:sender]];
[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration:0.3];
[UIView setAnimationTransition:UIViewAnimationTransitionFlipFromLeft forView:touchedButton cache:NO];
[UIView commitAnimations];
[touchedButton setImage:[UIImage imageNamed:[NSString stringWithFormat:@"%@.png",[touchedButton currentTitle]]] forState:UIControlStateNormal];
}


  
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐