-4
_options = [[NSArray arrayWithObjects:
             [NSDictionary dictionaryWithObjectsAndKeys:[UIImage imageNamed:@"facebook.png"],@"img",@"Facebook",@"text", nil],
             [NSDictionary dictionaryWithObjectsAndKeys:[UIImage imageNamed:@"twitter.png"],@"img",@"Twitter",@"text", nil], 
             [NSDictionary dictionaryWithObjectsAndKeys:[UIImage imageNamed:@"tumblr.png"],@"img",@"Tumblr",@"text", nil], 
             [NSDictionary dictionaryWithObjectsAndKeys:[UIImage imageNamed:@"google-plus.png"],@"img",@"Google+",@"text", nil], 
             [NSDictionary dictionaryWithObjectsAndKeys:[UIImage imageNamed:@"linkedin.png"],@"img",@"LinkedIn",@"text", nil], 
             [NSDictionary dictionaryWithObjectsAndKeys:[UIImage imageNamed:@"pinterest.png"],@"img",@"Pinterest",@"text", nil], 
             [NSDictionary dictionaryWithObjectsAndKeys:[UIImage imageNamed:@"dribbble.png"],@"img",@"Dribbble",@"text", nil], 
             [NSDictionary dictionaryWithObjectsAndKeys:[UIImage imageNamed:@"deviant-art.png"],@"img",@"deviantArt",@"text", nil], 
             nil];
4

2 回答 2

7

你把两个方括号放在你只需要一个的地方:

_options = [NSArray arrayWithObjects: // And so on...
//        ^^^ You need only one square bracket here
于 2012-11-27T03:23:50.750 回答
4

错误消息“预期标识符”表示您的方括号级别不正确。例如:

[7];

这是非法的,因为它周围有一组额外的方括号。这条线是合法的(但没用):

7;
于 2012-11-27T03:24:42.090 回答